Skip to main content

Using platform.sh environments for continuous integration / functional tests

Comments

1 comment

  • Larry

    Hi Daniel.

    The build environment is branch-agnostic. Since build images can be reused on multiple branches there’s no way to detect the branch during build.

    This is not something we currently support directly; you can run unit tests (that do not require access to the database) during build. More on that here: https://community.platform.sh/t/how-to-fail-a-build-on-failing-unit-tests/57

    For end to end tests, you would need to ensure the tools are installed in all environments. Then in a post_deploy hook, check if you’re on a branch where you want to run tests (at minimum, non-master), and run whatever commands you need. It’s better to do in post_deploy than deploy because deploy blocks the environment being publicly accessible, which may be necessary depending on the nature of your tests.

    The report-back in case of failure is the big challenge. At present we have no mechanism available to do that. If you have some external notification system that can accept a webhook, you can have your test code ping that URL when it’s done. We have no built-in support for it at this time, though.

    0

Please sign in to leave a comment.