I have the following bitbucket-pipeline.yml :
image: node:18.14.2
pipelines:
default:
- step:
name: Playwright Tests
image: mcr.microsoft.com/playwright:v1.29.2-focal
script:
- npm ci
- node -v
# - Run the test cases
- npx playwright test
artifacts:
- playwright-report/index.html
And no matter what version of node I use for the image the node -v command always shows
v16.19.0
G'day Guy!
Welcome to the Bitbucket Cloud community! :)
Based on the YML configuration you've shared, by defining image: node:18.14.2 at the top - this simply means that this image will be used by default for all builds unless specified otherwise in the build step.
For the Playwright Tests build step, you are explicitly defining that the mcr.microsoft.com/playwright:v1.29.2-focal image is to be used for this step, which overrides the node image you specified earlier in your configuration.
I've checked the playwright image locally in a Docker container and can see that the same node version is reported:
# docker run -it --entrypoint=/bin/sh mcr.microsoft.com/playwright:v1.29.2-focal
# node -v
v16.19.0
You will need to either:
a) Remove the playwright image definition in the build step so that the node image is used
b) Update the node version as part of your build step
I hope this helps!
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.