File: test.sh

package info (click to toggle)
scikit-build-core 0.11.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,588 kB
  • sloc: python: 14,643; ansic: 254; cpp: 134; sh: 27; fortran: 18; makefile: 7
file content (33 lines) | stat: -rwxr-xr-x 1,207 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# shellcheck disable=all
source /usr/share/beakerlib/beakerlib.sh || exit 1

rlJournalStart
    rlPhaseStartSetup
        rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
		    rlRun "rsync -r .$TMT_TEST_NAME/ $tmp" 0 "Copy example project"
        if [ "${HAS_PYTEST}" != True ]; then
		      rlRun "rsync -r ./docs/examples/getting_started/test.py $tmp" 0 "Copy test.py file"
        fi
        rlRun "pushd $tmp"
        rlRun "tree" 0 "Show directory tree"
        rlRun "python3 -m venv .venv --system-site-packages" 0 "Create venv with system packages"
        rlRun "source .venv/bin/activate" 0 "Activate venv"
        rlRun "set -o pipefail"
    rlPhaseEnd

    rlPhaseStartTest
        rlRun "pip install . -v --no-index --no-build-isolation" 0 "Build the python project"
        if [ "${HAS_PYTEST}" == True ]; then
          rlRun "python3 -m pytest" 0 "Run built-in pytest"
        else
          rlRun "python3 test.py" 0 "Test project is installed correctly"
        fi
    rlPhaseEnd

    rlPhaseStartCleanup
        rlRun "popd"
        rlRun "rm -r $tmp" 0 "Remove tmp directory"
    rlPhaseEnd
rlJournalEnd