3

My team has multiple Concourse pipelines and as we refactor tasks, we've realized the need to test our actual pipelines.

We already test our tasks by using environment variables enabling task scripts to be run locally, but the pipeline yaml is another matter.

What is the best way to accomplish testing of the pipeline itself?

2
  • What kinds of tests do you want to run specifically? Jul 26, 2017 at 21:59
  • I'm wondering how I can find out before my entire pipeline goes red that someone has done something like misconfigure the resource pool lock or the git release resource for instance. In production code, our tests would tell us these things, so that's why I say I'm looking for how to test the pipeline itself.
    – E. Beer
    Jul 27, 2017 at 16:43

2 Answers 2

0

You can use the Concourse Pipeline Resource to monitor the git repository where you keep your pipeline config. Whenever the pipeline resource detects a change, it will automatically run a fly set-pipeline to update the config in your running Concourse installation. From there, it's easy to script tests against the updated pipeline that is now running in your Concourse installation.

0

fly validate-pipeline is pretty useful, running that against pipelines before merging has caught a few bugs in "obviously correct" changes for me.

If you want to test the whole pipeline before merging you need to make sure that the data it's using is static and working (no sense in failing the pipeline if it's the repo that's broken), and that there are no side effects (like notifications) shared between the 'real pipeline' and the 'test pipeline'. I suspect that as long as you're careful with the restrictions, you could make it work, but it would have to be designed in the context of your existing pipelines and infrastructure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.