We are trying to configure, playwright browser tests on Bitbucket Pipeline as code is in same repo of Bitbucket.
While running it on local with below commands its working fine and reports are also getting generated. In total 72 tests are running and report is generated.
Below are the commands:
Hello @Ameer sohail ,
thank you for reaching out to the Atlassian Community!
In order to isolate if the issue is with Bitbucket Pipelines environment, or with the image/code/dependencies you are using, I would suggest trying to run your build locally inside a docker container following the instructions of the below article:
The instructions in that article are used to reproduce locally an environment as close as possible to Pipelines, so you can troubleshoot your build locally, and if the same behavior is reproduced locally, you can debug the build check different combinations or images/dependencies, and once you find one that works, you can update your bitbucket pipelines YML to match.
Thank you, @Ameer sohail !
Patrik S
Hello @Patrik S
Thanks for the reply tried with the process you shared above.
If I tried with similar docker commands its throwing errors with 7 test cases are failed.docker build --memory=1g --memory-swap=1g -t account/imageName:tag -f my.dockerfile .
docker run -it --memory=4g --memory-swap=4g --memory-swappiness=0 --cpus=4 --entrypoint=/bin/bash account/imageName:tag
Whereas if used docker commands without --memory=1g --memory-swap=1g
in docker build and --memory=4g --memory-swap=4g --memory-swappiness=0 --cpus=4 in docker run
its running all test cases successfully.
docker build -t myaccount/qa-automation-image:latest -f my.dockerfile .
docker run -it --entrypoint=/bin/bash myaccount/qa-automation-image
Attaching screenshots for both scenarios test cases failed and test cases passed successfully.
By this please let me know what sort of changes I need to do.
Note: In pipeline its not passing more than 5 to 7 cases and getting stuck
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Ameer sohail ,
I noticed that after the test is completed, playwright waits for the user to press Ctrl+C to quit the log stream, but since the pipeline environment is non-interactive, I suspect this may be holding the pipeline to complete.
To avoid that, I would recommend setting the environment variable CI=true (see Playwright- CI ) before executing the playwright command, as this should make it ignore the prompts for user input:
script:
- export CI="true"
- npm ci
- npx playwright install --with-deps
- npx playwright test
- npx playwright show-report
Thank you, @Ameer sohail !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Patrik S
Tried with suggestions you have shared above by adding CI=true, but still its getting stucked, attaching screenshot for your reference.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Ameer sohail ,
Thanks for executing that test. To rule out a possible memory allocation issue, could you increase that step to size:2x, so it will get double the memory (8GB), and check if the builds also time out?
- step:
size: 2x
script:
- <your build commands>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Ameer sohail ,
Thank you for going through those tests.
At this point, I've raised a support ticket for you to investigate this further, as you have access to a workspace with an active Bitbucket subscription. One of our support engineers will be in touch with you soon.
You will receive the ticket link in your email soon, but in case you don't, please let me know so I can share it here (the ticket will only be visible to you and Atlassian staff).
Thank you, @Ameer sohail !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.