mirror of
https://github.com/go-task/task.git
synced 2025-07-05 00:58:54 +02:00
fix ci test breakage (fork/exec ./bin/task: no such file or directory)
On Github actions, the destination path of "go install" ($GOPATH/bin) is not in $PATH, thus the error. For the life of me I could not understand how to change the $PATH environment variable in an Actions workflow, so I encode the full path of the just-built task executable in the tests, which probably was the right thing to do since the beginning.
This commit is contained in:
committed by
Wes McNamee
parent
22dfc1e265
commit
cacd57f72b
11
unix_test.go
11
unix_test.go
@ -1,3 +1,4 @@
|
|||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
// This file contains tests for signal handling on Unix.
|
// This file contains tests for signal handling on Unix.
|
||||||
@ -23,6 +24,10 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestSignalSentToProcessGroup(t *testing.T) {
|
func TestSignalSentToProcessGroup(t *testing.T) {
|
||||||
|
task, err := filepath.Abs("./bin/task")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
args []string
|
args []string
|
||||||
sendSigs int
|
sendSigs int
|
||||||
@ -32,7 +37,7 @@ func TestSignalSentToProcessGroup(t *testing.T) {
|
|||||||
// regression:
|
// regression:
|
||||||
// - child is terminated, immediately, by "context canceled" (another bug???)
|
// - child is terminated, immediately, by "context canceled" (another bug???)
|
||||||
"child does not handle sigint: receives sigint and terminates immediately": {
|
"child does not handle sigint: receives sigint and terminates immediately": {
|
||||||
args: []string{"task", "--", SLEEPIT, "default", "-sleep=10s"},
|
args: []string{task, "--", SLEEPIT, "default", "-sleep=10s"},
|
||||||
sendSigs: 1,
|
sendSigs: 1,
|
||||||
want: []string{
|
want: []string{
|
||||||
"sleepit: ready\n",
|
"sleepit: ready\n",
|
||||||
@ -51,7 +56,7 @@ func TestSignalSentToProcessGroup(t *testing.T) {
|
|||||||
// TODO we need -cleanup=2s only to show reliably the bug; once the fix is committed,
|
// TODO we need -cleanup=2s only to show reliably the bug; once the fix is committed,
|
||||||
// we can use -cleanup=50ms to speed the test up
|
// we can use -cleanup=50ms to speed the test up
|
||||||
"child intercepts sigint: receives sigint and does cleanup": {
|
"child intercepts sigint: receives sigint and does cleanup": {
|
||||||
args: []string{"task", "--", SLEEPIT, "handle", "-sleep=10s", "-cleanup=2s"},
|
args: []string{task, "--", SLEEPIT, "handle", "-sleep=10s", "-cleanup=2s"},
|
||||||
sendSigs: 1,
|
sendSigs: 1,
|
||||||
want: []string{
|
want: []string{
|
||||||
"sleepit: ready\n",
|
"sleepit: ready\n",
|
||||||
@ -70,7 +75,7 @@ func TestSignalSentToProcessGroup(t *testing.T) {
|
|||||||
},
|
},
|
||||||
// regression: child receives 2 signal instead of 1 and thus terminates abruptly
|
// regression: child receives 2 signal instead of 1 and thus terminates abruptly
|
||||||
"child simulates terraform: receives 1 sigint and does cleanup": {
|
"child simulates terraform: receives 1 sigint and does cleanup": {
|
||||||
args: []string{"task", "--", SLEEPIT, "handle", "-term-after=2", "-sleep=10s", "-cleanup=50ms"},
|
args: []string{task, "--", SLEEPIT, "handle", "-term-after=2", "-sleep=10s", "-cleanup=50ms"},
|
||||||
sendSigs: 1,
|
sendSigs: 1,
|
||||||
want: []string{
|
want: []string{
|
||||||
"sleepit: ready\n",
|
"sleepit: ready\n",
|
||||||
|
Reference in New Issue
Block a user