Convert STI to tmt plan
This commit is contained in:
parent
aa275fb893
commit
c8e42e2e9d
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
47
plan.fmf
Normal file
47
plan.fmf
Normal file
@ -0,0 +1,47 @@
|
||||
discover:
|
||||
how: shell
|
||||
dist-git-source: true
|
||||
tests:
|
||||
- name: smoke
|
||||
test: pybabel --list-locales
|
||||
- name: smoke2
|
||||
test: /usr/libexec/platform-python smoke.py
|
||||
path: /tests
|
||||
- name: unit tests
|
||||
test: |
|
||||
cleanup(){
|
||||
if [[ -n $TmpDir ]] && test -d $TmpDir; then
|
||||
rm -rf $TmpDir
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
TmpDir=$(mktemp -d)
|
||||
|
||||
# first, copy over unit tests and make them find the installed modules and
|
||||
# files as if they were an exploded source tarball
|
||||
cp -r $TMT_SOURCE_DIR/Babel-*/tests $TmpDir/
|
||||
|
||||
# test_frontend needs python3-freezegun
|
||||
rm $TmpDir/tests/messages/test_frontend.py
|
||||
|
||||
BABELDIR="$(/usr/libexec/platform-python -c 'import os.path; import babel; print(os.path.dirname(babel.__file__))')"
|
||||
ln -snf "$BABELDIR" $TmpDir/babel
|
||||
|
||||
pushd $TmpDir
|
||||
|
||||
# run the tests
|
||||
export TZ=America/New_York
|
||||
pytest-3
|
||||
|
||||
popd
|
||||
execute:
|
||||
how: tmt
|
||||
|
||||
prepare:
|
||||
- name: install packages
|
||||
how: install
|
||||
package:
|
||||
- python3-babel
|
||||
- python3-pytest
|
||||
@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# smoke tests for the babel runtime
|
||||
|
||||
# bail out on any error
|
||||
set -e
|
||||
|
||||
pybabel --list-locales
|
||||
@ -1,27 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Run Babel's unit tests with the installed packages.
|
||||
|
||||
# bail out if anything goes wrong
|
||||
set -e
|
||||
|
||||
# run in its own subdirectory without the whole sources underneath
|
||||
mkdir testrun
|
||||
|
||||
# first, copy over unit tests and make them find the installed modules and
|
||||
# files as if they were an exploded source tarball
|
||||
cp -r source/tests testrun/
|
||||
|
||||
# test_frontend needs python3-freezegun
|
||||
rm testrun/tests/messages/test_frontend.py
|
||||
|
||||
BABELDIR="$(python3 -c 'import os.path; import babel; print(os.path.dirname(babel.__file__))')"
|
||||
ln -snf "$BABELDIR" testrun/babel
|
||||
|
||||
pushd testrun
|
||||
|
||||
# run the tests
|
||||
export TZ=America/New_York
|
||||
pytest-3
|
||||
|
||||
popd # testrun
|
||||
4
tests/smoke.py
Normal file
4
tests/smoke.py
Normal file
@ -0,0 +1,4 @@
|
||||
from datetime import date
|
||||
from babel.dates import format_date
|
||||
|
||||
assert format_date(date(2021,3,1), locale='en') == 'Mar 1, 2021'
|
||||
@ -1,23 +0,0 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-source
|
||||
tags:
|
||||
- always
|
||||
|
||||
- role: standard-test-basic
|
||||
tags:
|
||||
- atomic
|
||||
- classic
|
||||
required_packages:
|
||||
- babel
|
||||
- coreutils
|
||||
- python3-babel
|
||||
- python3-pytest
|
||||
tests:
|
||||
- smoke:
|
||||
dir: .
|
||||
run: ./run-smoke-tests.sh
|
||||
- verify:
|
||||
dir: .
|
||||
run: ./run-unit-tests-on-installed-pkg.sh
|
||||
Loading…
Reference in New Issue
Block a user