buildkite / agent-stack-k8s

Spin up an autoscaling stack of Buildkite Agents on Kubernetes
MIT License
79 stars 30 forks source link

Fix extraVolumeMounts integration test #205

Closed triarius closed 1 year ago

triarius commented 1 year ago

This was failing because the checkout was failing. It used git mirrors on a volume mount, and I suspect some checkout in a previous build corrupted the mirror directory. The corruption indicates a bug with how the agent uses git mirrors. As we have plans to fix that in the agent repo, I'm not going to investigate that here.

In any case, agent-stack-k8s can protect itself from such bugs in the agent by not using the same volume across builds. Instead, I've checked that the volume is shared between steps (and therefore pods) in the same build.

I've also used a defer in the integration tests to clean up the pipelines that are created. It seems to me that the tests attempted to delete the pipeline as soon as it was created with back off. Seems a bit racy to me, so I moved the cleanup into a defer.

Also, I've made the build message in an integration test have the name of the test. I considered making it the pipeline name too, but the pipeline name needs to be unique. It already has a random component, and the name is constrained, so I don't think putting the test name in there will work.