-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adding parallel runners #50
Conversation
*out | ||
|
||
.DS_Store |
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.
add this to your global .gitignore
instead of here
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.
Amended the commit
We'll need to update the documentation but if you'd like I'll do that after we merge this |
I also wanted to add some tests to it. What do you think about the overall implementation? |
Looks good, nothing that jumps out at me. I'm going to clone it and test out it a bit. |
@@ -26,6 +26,7 @@ type config struct { | |||
DepWarnning string | |||
Script []string `yaml:"script"` | |||
Build []string `yaml:"build"` | |||
Runners []string `yaml:"runners"` |
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.
I was a bit swayed from seeing build
vs runners
. Maybe we can come up with a better name instead of runners
? Though for now this will suffice.
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.
I'm not too found of the name either. Not too sure what to call it. This is an after
/ run
hook.
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.
I would just rather make a change now than have to deprecate it in the near future.
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.
Right, I think simply run
describes what will happen to them. If we happen to add functionality down the line that allows these things to be ran sequentially we would have the option of adding async
blocks etc...
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.
I think run
fits nicely. I'll change it.
Closes issue #48 The snag.yml now accepts a 'Runners' tag. This tag represents a group of commands that are meant to be run in parallel after the build stage. Each process will be given a chance to start and will then get backgrounded to allow other processes to run. The output of each command is streamed to stdout prefix with the pid of the logging command
Latests changes:
verbose: true
ignore:
- .git
- snag
- snag.exe
build:
- go build
- go vet
- gofmt -l -s .
- go test . ./vow -test.short
run:
- go run test/binary1/main.go
- go run test/binary2/main.go
- go run test/binary3/main.go
package main
import (
"fmt"
"time"
)
func main() {
for i := 0; i < 10; i++ {
fmt.Printf("Sleep count %d\n", i)
time.Sleep(time.Second)
}
}
package main
import (
"fmt"
"os"
"time"
)
func main() {
for i := 8; i > 0; i-- {
fmt.Printf("Failing in %d\n", i)
time.Sleep(time.Second)
}
os.Exit(1)
}
package main
import (
"fmt"
"time"
)
func main() {
var count int
for range time.Tick(5 * time.Second) {
count++
fmt.Printf("Ticked count %d\n", count)
}
} |
Looks good, I'm going to merge this and we can iterate over it on master |
Closes #48
The snag.yml now accepts a 'Runners' tag. This tag represents a group
of commands that are meant to be run in parallel after the build stage.
Each process will be given a chance to start and will then get backgrounded
to allow other processes to run. The output of each command is streamed to
stdout prefix with the pid of the logging command