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
b1f00c57
Commit
b1f00c57
authored
11 years ago
by
Mike McQuaid
Browse files
Options
Downloads
Patches
Plain Diff
brew-test-bot: add optional JUnit support.
parent
05f92b5c
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/Contributions/cmd/brew-test-bot.rb
+30
-13
30 additions, 13 deletions
Library/Contributions/cmd/brew-test-bot.rb
with
30 additions
and
13 deletions
Library/Contributions/cmd/brew-test-bot.rb
+
30
−
13
View file @
b1f00c57
...
...
@@ -6,15 +6,17 @@
# --keep-logs: Write and keep log files under ./brewbot/
# --cleanup: Clean the Homebrew directory. Very dangerous. Use with care.
# --skip-setup: Don't check the local system is setup correctly.
# --junit: Generate a JUnit XML test results file.
require
'formula'
require
'utils'
require
'date'
require
'erb'
HOMEBREW_CONTRIBUTED_CMDS
=
HOMEBREW_REPOSITORY
+
"Library/Contributions/cmd/"
class
Step
attr_reader
:command
,
:repository
attr_reader
:command
,
:repository
,
:name
attr_accessor
:status
def
initialize
test
,
command
...
...
@@ -269,17 +271,16 @@ class Test
status
==
:passed
end
def
self
.
run
argument
test
=
new
argument
test
.
cleanup_before
test
.
download
test
.
setup
unless
ARGV
.
include?
"--skip-setup"
test
.
formulae
.
each
do
|
formula
|
test
.
formula
formula
def
run
cleanup_before
download
setup
unless
ARGV
.
include?
"--skip-setup"
formulae
.
each
do
|
f
|
formula
(
f
)
end
test
.
homebrew
if
test
.
core_changed
test
.
cleanup_after
test
.
check_results
homebrew
if
core_changed
cleanup_after
check_results
end
end
...
...
@@ -287,11 +288,27 @@ if Pathname.pwd == HOMEBREW_PREFIX and ARGV.include? "--cleanup"
odie
'cannot use --cleanup from HOMEBREW_PREFIX as it will delete all output.'
end
tests
=
[]
any_errors
=
false
if
ARGV
.
named
.
empty?
# With no arguments just build the most recent commit.
any_errors
=
Test
.
run
'HEAD'
test
=
Test
.
new
(
'HEAD'
)
any_errors
=
test
.
run
tests
<<
test
else
ARGV
.
named
.
each
{
|
argument
|
any_errors
=
Test
.
run
(
argument
)
or
any_errors
}
ARGV
.
named
.
each
do
|
argument
|
test
=
Test
.
new
(
argument
)
any_errors
=
test
.
run
or
any_errors
tests
<<
test
end
end
if
ARGV
.
include?
"--junit"
xml_erb
=
HOMEBREW_CONTRIBUTED_CMDS
+
"brew-test-bot.xml.erb"
erb
=
ERB
.
new
IO
.
read
xml_erb
open
(
"brew-test-bot.xml"
,
"w"
)
do
|
xml
|
xml
.
write
erb
.
result
binding
end
end
exit
any_errors
?
0
:
1
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