Skip to content
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

[UI] - Adjusting the logic to use the new cypress config execution #65

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions templates/dashboard-tests/overlay/tmp/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ build_image () {
echo "${PWD}"
node -v
npm version
npm install -g yarn junit-report-merger mocha mochawesome mochawesome-merge mochawesome-report-generator

npm install -g yarn
yarn config set ignore-engines true
yarn global add junit-report-merger

cd ${HOME}

echo "junit-report-merger version: "
jrm --version
echo "mochawesome-merge version: "
marge --version

DOCKERFILE_PATH="dashboard/cypress/jenkins"

Expand Down Expand Up @@ -152,7 +154,7 @@ rancher_init () {
branch_from_rancher=`curl -s -k -X GET "https://${RANCHER_HOST}/v1/management.cattle.io.settings" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${rancher_token}" | grep -o '"default":"[^"]*' | grep -o '[^"]*$' | grep release- | sed -E 's/^\s*.*:\/\///g' | cut -d'/' -f 3 | tail -n 1`

if [[ -z "${branch_from_rancher}" ]]; then
is_it_latest=`curl -s -k -X GET "https://${RANCHER_HOST}/dashboard/about" \
-H "Accept: text/html,application/xhtml+xml,application/xml" \
Expand Down Expand Up @@ -282,14 +284,10 @@ DASHBOARD_PATH="${HOME}/dashboard"
sudo chown -R "$(whoami)" .
echo "${PWD}"
find "${HOME}" -type f -iname "*.xml" -not -path "*node_modules*" -not -path "*golang*"
find "${HOME}" -type f -iname "*mochawesome*" -not -path "*node_modules*"
find "${HOME}" -type f -iname "*.html" -not -path "*node_modules*" -not -path "*golang*"

jrm "${DASHBOARD_PATH}/results.xml" "${DASHBOARD_PATH}/cypress/jenkins/reports/junit/junit-*" || { echo 'junit reporting failed' ; exit 1; }

mochawesome-merge "${DASHBOARD_PATH}/cypress/jenkins/reports/mochawesome/*.json" \
-o "${DASHBOARD_PATH}/results.json"
marge -o "${DASHBOARD_PATH}" "${DASHBOARD_PATH}/results.json" || { echo 'html reporting failed' ; exit 1; }

if [ -s "${DASHBOARD_PATH}/results.xml" ]; then
corral_set cypress_completed "completed"
fi
Expand Down