atc: backfill tests for recursive task caches
@@ -2047,11 +2047,7 @@ var _ = Describe("Team", func() {
},
{
Task: "some-task",
- Privileged: true,
File: "some/config/path.yml",
- TaskConfig: &atc.TaskConfig{
- RootfsURI: "some-image",
- },
},
{
Put: "some-resource",
@@ -2059,6 +2055,14 @@ var _ = Describe("Team", func() {
"some-param": "some-value",
},
},
+ {
+ Do: &atc.PlanSequence{
+ {
+ Task: "some-nested-task",
+ File: "some/config/path.yml",
+ },
+ },
+ },
},
}
@@ -2152,6 +2156,13 @@ var _ = Describe("Team", func() {
Expect(err).ToNot(HaveOccurred())
Expect(found).To(BeTrue())
+ _, err = taskCacheFactory.FindOrCreate(job.ID(), "some-nested-task", "some-path")
+ Expect(err).ToNot(HaveOccurred())
+
+ _, found, err = taskCacheFactory.Find(job.ID(), "some-nested-task", "some-path")
+ Expect(err).ToNot(HaveOccurred())
+ Expect(found).To(BeTrue())
+
config.Jobs = []atc.JobConfig{}
_, _, err = team.SavePipeline(pipelineName, config, pipeline.ConfigVersion(), false)
@@ -2160,6 +2171,10 @@ var _ = Describe("Team", func() {
_, found, err = taskCacheFactory.Find(job.ID(), "some-task", "some-path")
Expect(err).ToNot(HaveOccurred())
Expect(found).To(BeFalse())
+
+ _, found, err = taskCacheFactory.Find(job.ID(), "some-nested-task", "some-path")
+ Expect(err).ToNot(HaveOccurred())
+ Expect(found).To(BeFalse())
})
It("removes task caches for tasks that are no longer exist", func() {
@@ -2177,6 +2192,13 @@ var _ = Describe("Team", func() {
Expect(err).ToNot(HaveOccurred())
Expect(found).To(BeTrue())
+ _, err = taskCacheFactory.FindOrCreate(job.ID(), "some-nested-task", "some-path")
+ Expect(err).ToNot(HaveOccurred())
+
+ _, found, err = taskCacheFactory.Find(job.ID(), "some-nested-task", "some-path")
+ Expect(err).ToNot(HaveOccurred())
+ Expect(found).To(BeTrue())
+
config.Jobs = []atc.JobConfig{
{
Name: "some-job",
@@ -2195,6 +2217,10 @@ var _ = Describe("Team", func() {
_, found, err = taskCacheFactory.Find(job.ID(), "some-task", "some-path")
Expect(err).ToNot(HaveOccurred())
Expect(found).To(BeFalse())
+
+ _, found, err = taskCacheFactory.Find(job.ID(), "some-nested-task", "some-path")
+ Expect(err).ToNot(HaveOccurred())
+ Expect(found).To(BeFalse())
})
It("should not remove task caches in other pipeline", func() {
