-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Make jasmine tests quieter #409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,3 +45,4 @@ node_modules | |
| autodeploy.properties | ||
| .ws_migrations_complete | ||
| .vagrant/ | ||
| logs | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,8 +52,14 @@ def when_changed(unchanged_message, files, dirs=[]) | |
|
|
||
| # Runs Process.spawn, and kills the process at the end of the rake process | ||
| # Expects the same arguments as Process.spawn | ||
| def background_process(*command) | ||
| pid = Process.spawn({}, *command, {:pgroup => true}) | ||
| def background_process(command, logfile=nil) | ||
| spawn_opts = {:pgroup => true} | ||
| if !logfile.nil? | ||
| puts "Running '#{command.join(' ')}', redirecting output to #{logfile}".red | ||
| spawn_opts[[:err, :out]] = [logfile, 'a'] | ||
| end | ||
| pid = Process.spawn({}, *command, spawn_opts) | ||
| command = [*command] | ||
|
|
||
| at_exit do | ||
| puts "Ending process and children" | ||
|
|
@@ -88,9 +94,10 @@ def background_process(*command) | |
|
|
||
| # Runs a command as a background process, as long as no other processes | ||
| # tagged with the same tag are running | ||
| def singleton_process(*command) | ||
| def singleton_process(command, logfile=nil) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't assets.rake call this function, so doesn't that file need to adapt to the star/no-star change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assets.rake just uses single string commands already anyway, so there's no change in that file. |
||
| command = [*command] | ||
| if Sys::ProcTable.ps.select {|proc| proc.cmdline.include?(command.join(' '))}.empty? | ||
| background_process(*command) | ||
| background_process(command, logfile) | ||
| else | ||
| puts "Process '#{command.join(' ')} already running, skipping".blue | ||
| end | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There already a ../log directory, maybe we don't need this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jenkins doesn't have that directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And ruby doesn't know about the python variables that define the log directory.