blob: 4037697566410c5c49c39c61699ac5c41c108d4c [file] [log] [blame]
Ievgeniia Zadorozhna45cf52f2025-10-24 18:32:56 +02001#!/bin/bash
2
3. "$(dirname "$0")/functions.sh"
4cd $MY_PROJFOLDER/tmp
5source $MY_PROJFOLDER/env.sh
6source $MY_PROJFOLDER/envs/mgmtrc
7source /opt/ksi/.ksivenv/bin/activate
8
9fname="$MY_PROJFOLDER/reports/$MY_CLIENTSHORTNAME-k0rdent-sanity-$(get_timestamp).html"
10
11# Cleaning up
12echo "# Cleaning up '$MY_PROJFOLDER/tmp/artifacts/'"
13[ -d "$MY_PROJFOLDER/tmp/artifacts/" ] && rm -rf "$MY_PROJFOLDER/tmp/artifacts/"
14[ -f "$MY_PROJFOLDER/tmp/nosetests.xml" ] && rm "$MY_PROJFOLDER/tmp/nosetests.xml"
15mkdir "$MY_PROJFOLDER/tmp/artifacts/"
16
17# recreate the sanity reports dir to have fresh artifacts
18sanity_reports_dir="$MY_PROJFOLDER/reports/sanity"
19if [ -d $sanity_reports_dir ]; then
20 yes | rm $sanity_reports_dir/*
21else
22 mkdir $sanity_reports_dir
23fi
24
25# Run the sanity tests
26pytest -m sanity \
27 -p pytest_subtests \
28 -v \
29 --tb=short \
30 --color=yes \
31 -p no:warnings \
32 -p no:sugar \
33 --junitxml=$sanity_reports_dir/sanity-checks-results.xml \
34 --html=$sanity_reports_dir/sanity-checks-results.html \
35 --self-contained-html \
36 -r s \
37 /opt/ksi/test_sanity_checks.py
38
39if [ "$(ls -A "$MY_PROJFOLDER/tmp/artifacts" 2>/dev/null)" ]; then
40 cp "$MY_PROJFOLDER/tmp/artifacts/"* "$sanity_reports_dir"
41fi
42
43cp $sanity_reports_dir/sanity-checks-results.html ${fname}
44update_latest_report_to "${fname}"
45
46deactivate