Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
b0d10fdf
Commit
b0d10fdf
authored
4 years ago
by
Rylan Polster
Browse files
Options
Downloads
Patches
Plain Diff
add audit tests for migrated audit exception lists
parent
899783b3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/test/dev-cmd/audit_spec.rb
+85
-0
85 additions, 0 deletions
Library/Homebrew/test/dev-cmd/audit_spec.rb
with
85 additions
and
0 deletions
Library/Homebrew/test/dev-cmd/audit_spec.rb
+
85
−
0
View file @
b0d10fdf
...
...
@@ -560,6 +560,91 @@ module Homebrew
end
end
describe
"#audit_specs"
do
let
(
:throttle_list
)
{
{
throttled_formulae:
{
"foo"
=>
10
}
}
}
let
(
:versioned_head_spec_list
)
{
{
versioned_head_spec_allowlist:
[
"foo"
]
}
}
it
"allows versions with no throttle rate"
do
fa
=
formula_auditor
"bar"
,
<<~
RUBY
,
core_tap:
true
,
tap_audit_exceptions:
throttle_list
class Bar < Formula
url "https://brew.sh/foo-1.0.1.tgz"
end
RUBY
fa
.
audit_specs
expect
(
fa
.
problems
).
to
be_empty
end
it
"allows major/minor versions with throttle rate"
do
fa
=
formula_auditor
"foo"
,
<<~
RUBY
,
core_tap:
true
,
tap_audit_exceptions:
throttle_list
class Foo < Formula
url "https://brew.sh/foo-1.0.0.tgz"
end
RUBY
fa
.
audit_specs
expect
(
fa
.
problems
).
to
be_empty
end
it
"allows patch versions to be multiples of the throttle rate"
do
fa
=
formula_auditor
"foo"
,
<<~
RUBY
,
core_tap:
true
,
tap_audit_exceptions:
throttle_list
class Foo < Formula
url "https://brew.sh/foo-1.0.10.tgz"
end
RUBY
fa
.
audit_specs
expect
(
fa
.
problems
).
to
be_empty
end
it
"doesn't allow patch versions that aren't multiples of the throttle rate"
do
fa
=
formula_auditor
"foo"
,
<<~
RUBY
,
core_tap:
true
,
tap_audit_exceptions:
throttle_list
class Foo < Formula
url "https://brew.sh/foo-1.0.1.tgz"
end
RUBY
fa
.
audit_specs
expect
(
fa
.
problems
.
first
[
:message
]).
to
match
"should only be updated every 10 releases on multiples of 10"
end
it
"allows non-versioned formulae to have a `HEAD` spec"
do
fa
=
formula_auditor
"bar"
,
<<~
RUBY
,
core_tap:
true
,
tap_audit_exceptions:
versioned_head_spec_list
class Bar < Formula
url "https://brew.sh/foo-1.0.tgz"
head "https://brew.sh/foo-1.0.tgz"
end
RUBY
fa
.
audit_specs
expect
(
fa
.
problems
).
to
be_empty
end
it
"doesn't allow versioned formulae to have a `HEAD` spec"
do
fa
=
formula_auditor
"bar@1"
,
<<~
RUBY
,
core_tap:
true
,
tap_audit_exceptions:
versioned_head_spec_list
class BarAT1 < Formula
url "https://brew.sh/foo-1.0.tgz"
head "https://brew.sh/foo-1.0.tgz"
end
RUBY
fa
.
audit_specs
expect
(
fa
.
problems
.
first
[
:message
]).
to
match
"Versioned formulae should not have a `HEAD` spec"
end
it
"allows ersioned formulae on the allowlist to have a `HEAD` spec"
do
fa
=
formula_auditor
"foo"
,
<<~
RUBY
,
core_tap:
true
,
tap_audit_exceptions:
versioned_head_spec_list
class Foo < Formula
url "https://brew.sh/foo-1.0.tgz"
head "https://brew.sh/foo-1.0.tgz"
end
RUBY
fa
.
audit_specs
expect
(
fa
.
problems
).
to
be_empty
end
end
describe
"#audit_deps"
do
describe
"a dependency on a macOS-provided keg-only formula"
do
describe
"which is allowlisted"
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment