I am trying to build a pipeline for automating cypress tests.
Currently I am getting no indication what so ever that the defined env variables (primarily defined in the repo, workspace and test deploy environment) has been read. when printing the vars using 'echo', i get their names and not their values.
I am also new to yml and would appreciate a clue on how to change the above file using variables etc.
Below is a shortened version for my bitbucket-pipelines.yml file and some of the errors I'm getting.
Shiri.
I have found out that the params are not read when using repo 'secured' button, and read otherwise. why is that? how can I use then when secured?
Thanks.
image: cypress/browsers:node14.17.0-chrome88-ff89
pipelines:
default:
- step:
name: Build and Test
caches:
- node
- cypress
script:
# install dependencies
- echo '################# Printing vars to see what is available...###################'
- echo '"$FIRST_PARAM_FROM_WORKSPACE_OR_REPO"'
- export FIRST_PARAM_FROM_WORKSPACE_OR_REPO='"http"'
- echo '"$FIRST_PARAM_FROM_WORKSPACE_OR_REPO"'
- echo SECOND_PARAM_FROM_WORKSPACE_OR_REPO="$SECOND_PARAM_FROM_WORKSPACE_OR_REPO" >> .env
- echo FIRST_PARAM_FROM_WORKSPACE_OR_REPO="$FIRST_PARAM_FROM_WORKSPACE_OR_REPO" >> .env.local
- cat .env
# install dependencies
- npm install
- npm ci
- npx browserslist@latest --update-db
# start the server in the background
- npm run start:ci &
# run Cypress tests in Firefox
# - npx cypress run --browser chrome
- npx cypress run --spec "cypress/integration/my_test_file.spec.js"
services:
- mongo
artifacts:
# store any generates images and videos as artifacts
- cypress/screenshots/**
- cypress/videos/**
# install dependencies
- npm ci
# start the server in the background
- npm run start:ci &
# run Cypress tests
- npm run e2e
- step:
name: Code linting
script:
- npm install eslint
- npx eslint .
caches:
- node
definitions:
services:
mongo:
image: mongo
caches:
npm: $HOME/.npm
cypress: $HOME/.cache/Cypress
======= Using the log, I see the following errors: ======
<span>[494:0503/123609.061177:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon</span>
<span>[494:0503/123609.066478:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 781: Permission denied (13)</span>
<span>Browserslist: caniuse-lite is outdated. Please run:</span>
<span>npx browserslist@latest --update-db</span>
<span>Why you should do it regularly:</span>
<span>$FIRST_PARAM://<some_link></span>
<span>share anyone</span>
<span>1) "before all" ..</span>
<span>0 passing</span><span> (843ms)</span>
<span>1 failing</span>
<span>"before all" hook for "(First initial method before testing)":</span>
<span>CypressError: `cy.request()` failed trying to load:</span>
<span>$SECOND_PARAM/<some_link></span>
-----------------------------------------------------
<span>Thanks.</span>