github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/topgun/core/unique_versions_test.go (about)

     1  package topgun_test
     2  
     3  import (
     4  	. "github.com/pf-qiu/concourse/v6/topgun/common"
     5  	_ "github.com/lib/pq"
     6  	. "github.com/onsi/ginkgo"
     7  	. "github.com/onsi/gomega"
     8  )
     9  
    10  var _ = Describe("Unique Version History", func() {
    11  	BeforeEach(func() {
    12  		Deploy("deployments/concourse.yml",
    13  			"-o", "operations/enable-global-resources.yml")
    14  		_ = WaitForRunningWorker()
    15  	})
    16  
    17  	BeforeEach(func() {
    18  		By("setting a pipeline with a time resource")
    19  		Fly.Run("set-pipeline", "-n", "-c", "pipelines/time-resource.yml", "-p", "time-resource-1")
    20  
    21  		By("unpausing the pipeline")
    22  		Fly.Run("unpause-pipeline", "-p", "time-resource-1")
    23  
    24  		By("setting another pipeline with a time resource")
    25  		Fly.Run("set-pipeline", "-n", "-c", "pipelines/time-resource.yml", "-p", "time-resource-2")
    26  
    27  		By("unpausing the pipeline")
    28  		Fly.Run("unpause-pipeline", "-p", "time-resource-2")
    29  	})
    30  
    31  	It("creates unique version history for each time resource", func() {
    32  		By("running the check for the first pipeline")
    33  		Fly.Run("check-resource", "-r", "time-resource-1/time-resource")
    34  
    35  		By("running the check for the second pipeline")
    36  		Fly.Run("check-resource", "-r", "time-resource-2/time-resource")
    37  
    38  		By("getting the versions for the first time resource")
    39  		versions1 := Fly.GetVersions("time-resource-1", "time-resource")
    40  
    41  		By("getting the versions for the second time resource")
    42  		versions2 := Fly.GetVersions("time-resource-2", "time-resource")
    43  
    44  		Expect(versions1).ToNot(Equal(versions2))
    45  	})
    46  })