New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS tutorial #6
Comments
This would be very helpful for us. We are running into the issue where our tests take too long, but reading the documentation right now, not sure how we'd set it up in AWS. |
I'm just going to leave some notes on how I am running. I use CodePipeline for the flow (git repo, CodeBuild, CodeDeploy, etc). THIS COMMENT is not about deploying sorry-cypress (although my CodeDeploy does that), but focusing on getting my Cypress to run in parallel and point to sorry-cypress's Director. After my CodeBuild and CodeDeploy (site is deployed to Elastic Beanstalk), I added another 'Stage' and put all of my Cypress tests. I launch 5 in parallel. Here is what each of the Cypress CodeBuilds look like: Then I created a buildspec for my Cypress run. Note the following things I am doing in there:
Here is what my cypress package.json has in it:
And then in the cypress.js script, I have the following parameters passed into cypress:
|
@mlsad3 thanks a lot for sharing the details - I will definitely use it for a tutorial! |
Here are a few other files my Cypress runs use. Since I don't really use Dashboard (just using Director), I still want to see a report of the results. With all of the jobs running on separate instances, my report merge command only has access to the local subset of tests. Also, I do not know if I am the 'last' machine running. It would be annoying to get 5-6 different emails about the same test results instead of one final email sent by the final process. One way to do this would be to have a new AWS Pipeline Stage setup that starts once all the tests are finished, and it grabs the data and sends it back. Instead, I added a little synchronization inside the cypress.js that uploads the unique machine id ($CODEBUILD_BUILD_NUMBER is assigned to uniqueId) to AWS S3, and when the job finishes, I delete the unique machine id. If the cypress.js sees that all other unique machine ids are deleted, then there is a VERY good chance that we are the last Cypress process running. In that case, go ahead and download everyone else's test results, and run the merge command. Then email the results. I used to attach the merged single-file-html to the email, but now have it getting uploaded to a protected S3 bucket, and emailing a link to that...my link only works if you are authenticated on my website. So that url code wouldn't really work for others, but I'm leaving it in just to give an idea. scripts/cypress.js
helpers/awss3.js
helpers/contact.js
|
🔥 You can now deploy the whole solution as AWS CloudFormation stack. Check out this tutorial: @mlsad3 |
@agoldis Neat tutorial :) It would be cool (didn't see it, and not sure how easily it is for you to determine) if you could add rough cost ideas to it in the tl;dr section (ie $$ for foo and $$ for blah per month) |
@mlsad3 You've got it. Check the updated wiki. https://github.com/agoldis/sorry-cypress/wiki/AWS-Tutorial#aws-resources-pricing-per-month |
Perfect thanks!
…On Sun, Mar 1, 2020, 11:56 PM Andrew Goldis ***@***.***> wrote:
@mlsad3 <https://github.com/mlsad3> You've got it. Check to updated wiki
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADX3Z5I5LFODK6263UA5IBTRFNKCVANCNFSM4JEORF2A>
.
|
This is awesome @agoldis ! Got it working on our system - had to change some things in the cloudformation template since we aren't allowed to create public resources, but works well! Is the load balancing based on the key of the records? |
@tallkid24 great! Load balancing is just to allow a constant access point to the services and manage access URLs, e.g. /api points to a different container... If that's what you asked :) |
@agoldis sorry, I meant more of this https://docs.cypress.io/guides/guides/parallelization.html#Balance-strategy where it load balances the spec files on the different Cypress runs based on the length of the spec |
@tallkid24 oh, I see :) |
@agoldis ok cool, was just checking. Maybe a future feature ;) this is good stuff, thanks so much! |
@mlsad3 I've copied your tutorial to Thanks for your help! |
@agoldis Cool, thanks for putting it in there for posterity :) |
@agoldis I've attached a couple codebuild buildspec files that I'm using with your AWS tutorial, you can use them if you want in the tutorial, if not that's fine, but figure I should help contribute if I can. This first buildspec if what we use in our pipeline to verify an environment once we've already deployed. The second buildspec is one we use in our merge requests as a runner before we can merge into master (just to verify we aren't breaking anything) Edit: I should also note that the codebuilds are running on the cypress/browsers docker images https://hub.docker.com/r/cypress/browsers buildspec-test.yml
buildspec-ci-test.yml
|
@KyleThenTR great! I have published on wiki and added a link from AWS tutorial. Thanks for your contribution! |
Hi, great work ! Could you tell us what is there in your cy:merge-results and cy:generate-report commands ? Thanks. |
@DanielCambray oh sure, here are the 2 commands
It's using these libraries:
|
Create demo / tutorial for running the project on AWS:
Screenshots:
The text was updated successfully, but these errors were encountered: