forked from joshzarrabi/concourse-smoke-tests
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_a_job_test.go
35 lines (27 loc) · 868 Bytes
/
run_a_job_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package smoke_tests
import (
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"github.com/onsi/gomega/gexec"
)
var _ = Describe("Run a job", func() {
BeforeEach(func() {
Eventually(func() *gexec.Session {
login := spawnFlyLogin()
<-login.Exited
return login
}, 2*time.Minute, time.Second).Should(gexec.Exit(0))
fly("set-pipeline", "-p", "trigger-pipeline", "-c", "fixtures/trigger-pipeline.yml", "-n")
fly("unpause-pipeline", "-p", "trigger-pipeline")
})
AfterEach(func() {
fly("destroy-pipeline", "-p", "trigger-pipeline", "-n")
})
It("can run a job and connect to the internet", func() {
fly("trigger-job", "--job", "trigger-pipeline/do-something")
watch := waitForBuildAndWatch("trigger-pipeline/do-something")
Eventually(watch).Should(gbytes.Say("some-resource/input"))
})
})