Branch deploys only for running tests

Hello,

I’ve posted recently about my build setup and that has been working well. In summary, on certain builds I chain multiple commands together to run Jest tests, then RSpec and finally the Middleman build. However the tests take quite a while to complete and having all of the commands running one after the other means it takes a while to see a preview.

Is it possible to just have the deploy previews setup to run the Middleman build whilst all the branch deploys run the Jest and RSpec tests? This way our team could quickly view the deploy while the tests are finishing and then we also still get the tests notifications in GitHub to see if changes can be merged. I have tried this but once the tests finish, the build machine is expecting to find content in my publish directory which clearly won’t exist in this case. Is it possible to exit straight after the tests with a success flag or is it even possible to do this?

Any help or alternate suggestions would be greatly appreciated.

Thanks,
Jeff

I can see what the issue is now. Before the build, I can just create the published directory and then run the tests. Once the tests finish, it sees the empty publish directory and there is nothing to do and then says the build is successful.

One thing I noticed is that the branch build don’t send notifications to GitHub so I’ll have to write something custom to make that work.

Hiya @knoxjeffrey and sorry to be slow to get back to you! I think your diagnosis is correct- if your tests don’t build the site in the usual directory, the build cannot be deployed :slight_smile:

However, all builds should send notifications to GitHub - only PR’s send some types, but all normal branch commits - production or no - should send notifications. Are you not seeing the usual notifications that you would from a commit on master, in the branch build?