|
2 | 2 |
|
3 | 3 | shopt -s extglob |
4 | 4 | set -e |
| 5 | +trap 'echo "FAILED at line $LINENO: $BASH_COMMAND (exit $?)"' ERR |
5 | 6 |
|
6 | 7 | # Source the local configuration file to generate .env |
7 | 8 | source cypress/jenkins/configure.sh |
@@ -63,7 +64,7 @@ build_image() { |
63 | 64 | if [ "${target_branch}" != "master" ]; then |
64 | 65 | echo "Overlaying cypress/jenkins and dependencies from master onto ${target_branch}" |
65 | 66 | git fetch origin master |
66 | | - git checkout origin/master -- cypress/jenkins cypress/support package.json yarn.lock cypress.config.ts || true |
| 67 | + git checkout origin/master -- cypress/jenkins cypress/package.json cypress/support/qase.ts package.json yarn.lock cypress.config.ts || true |
67 | 68 | fi |
68 | 69 | cd "${HOME}" |
69 | 70 |
|
@@ -92,16 +93,24 @@ build_image() { |
92 | 93 | cd "${HOME}"/dashboard |
93 | 94 |
|
94 | 95 | npm install -g yarn@"${YARN_VERSION}" |
95 | | - yarn config set ignore-engines true --silent |
96 | 96 |
|
97 | | - yarn install --frozen-lockfile |
| 97 | + # Install only test dependencies from cypress/package.json |
| 98 | + # This skips the full dashboard monorepo (Vue, webpack, @rancher/components) |
| 99 | + cd cypress |
| 100 | + echo "Installing deps from $(pwd)/package.json" |
| 101 | + yarn install |
| 102 | + cd .. |
| 103 | + |
| 104 | + # Symlink so Cypress 11 can resolve ts-node/typescript from the project root |
| 105 | + # (Cypress uses require.resolve with { paths: [projectRoot] } which ignores NODE_PATH) |
| 106 | + ln -sf cypress/node_modules node_modules |
98 | 107 |
|
99 | 108 | # Debugging node_modules |
100 | | - if [ -d "node_modules/cypress-multi-reporters" ]; then |
101 | | - echo "Reporter found in dashboard/node_modules" |
| 109 | + if [ -d "cypress/node_modules/cypress-multi-reporters" ]; then |
| 110 | + echo "Reporter found in cypress/node_modules" |
102 | 111 | else |
103 | | - echo "ERROR: Reporter NOT found in dashboard/node_modules" |
104 | | - for module_path in node_modules/*cypress*; do |
| 112 | + echo "ERROR: Reporter NOT found in cypress/node_modules" |
| 113 | + for module_path in cypress/node_modules/*cypress*; do |
105 | 114 | [ -e "${module_path}" ] || continue |
106 | 115 | basename "${module_path}" |
107 | 116 | done |
@@ -234,7 +243,7 @@ elif [ "${RANCHER_TYPE:-existing}" = "recurring" ]; then |
234 | 243 | fi |
235 | 244 |
|
236 | 245 | cd "${HOME}/dashboard" || exit 1 |
237 | | -./node_modules/.bin/jrm "${HOME}/dashboard/results.xml" "cypress/jenkins/reports/junit/junit-*" || true |
| 246 | +./cypress/node_modules/.bin/jrm "${HOME}/dashboard/results.xml" "cypress/jenkins/reports/junit/junit-*" || true |
238 | 247 |
|
239 | 248 | if [ -s "${HOME}/dashboard/results.xml" ]; then |
240 | 249 | echo "cypress_exit_code=${exit_code}" |
|
0 commit comments