https://github.com/galaxyproject/galaxy
Raw File
Tip revision: d5f8feb3aeb96ce11cafd4703f55b2e5d6076e37 authored by John Chilton on 23 September 2024, 13:06:21 UTC
Merge pull request #18854 from ahmedhamidawan/fix_flaky_toolbox_selenium
Tip revision: d5f8feb
check_test_class_names.sh
#!/bin/sh
TEST=$(mktemp)
TEST_EXTRA_CLASSES=$(mktemp)

pytest --collect-only --ignore=test/functional lib/galaxy_test/ test/ > "$TEST"
pytest -o python_classes='Test* *Test *TestCase' --collect-only --ignore=test/functional lib/galaxy_test/ test/ > "$TEST_EXTRA_CLASSES"

n_tests=$(grep 'tests collected' "$TEST" | sed -e 's/[^0-9]*\([0-9]*\) tests collected.*/\1/')
n_tests_extra_classes=$(grep 'tests collected' "$TEST_EXTRA_CLASSES" | sed -e 's/[^0-9]*\([0-9]*\) tests collected.*/\1/')

if [ "$n_tests_extra_classes" -gt "$n_tests" ]; then
    echo "New test class with name not starting with Test introduced, change it to have tests collected by pytest"
    diff "$TEST" "$TEST_EXTRA_CLASSES"
    exit 1
fi
back to top