a year ago
We would like to run smoke tests against deployed PR environment. Is it possible to wait for Railway deployment and then get a callback with deployed URL we can then use to run smoke tests?
We are using simple Axios+Jest setup inside Github actions to run most important user flows, so I'd appreciate an answer tailored to that setup.
7 Replies
a year ago
You should be able to do this with the CLI. You can do a railway up --ci, which will wait for the deploy itself to become healthy
From there, all our environments follow the same pattern which is based on the PR number. I assume you're running this inside of actions or something like that?
Status changed to Awaiting User Response Railway • over 1 year ago
a year ago
Sorry for late response, our attention was shifted to other things for a good week but now I have time to revisit this question.
Originally, my question was about automatic PR environments that are created automatically for each pull request. Since I asked it, we made changes to our CI/CD and therefore disconnected all branches on all environments and always deploy from Github actions (via Railway CLI). Only then we realised that automatic PR environments don't work any more. Is that expected behaviour? I find it odd but if that's how it is, I won't complain.
Status changed to Awaiting Railway Response Railway • over 1 year ago
a year ago
So, what I'm trying to say: If automatic PR deploys don't work any more, we'll have to deploy PR environments ourselves too and you already explained that use case (with railway up --ci). 
But originally my question was about automatic PR deploys.
a year ago
Doesn't matter how you create environments, as long as the service in the base environment has a domain, so will the service in the cloned environment.
Status changed to Awaiting User Response Railway • over 1 year ago
a year ago
Given this PR, there are 2 actions that ran, one is our own PR workflow and another is automatic deployment to PR environment. Is it possible to get the URL of deployed environment in `Pull request flow / Test app (pull_request)` workflow?
Attachments
Status changed to Awaiting Railway Response Railway • over 1 year ago
a year ago
After re-reading Jake's answer I realised I can guess the environment's url from PR's id. So, that's one part of my question answered 
I still with to learn how to wait on automatic deployment to PR environment so that I can be sure that new API is ready to be tested with `Pull request flow / Test app (pull_request)`
Status changed to Awaiting User Response Railway • over 1 year ago
6 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 6 months ago