Repository navigation
84 lines (74 loc) · 2.74 KB
/
Copy pathpython-tests.yml
File metadata and controls
84 lines (74 loc) · 2.74 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Python tests
on:
push:
pull_request:
branches: [v2-main]
jobs:
tests:
name: tests (${{ matrix.python-version }}${{ matrix.container && ', AlmaLinux 9' || '' }})
runs-on: ubuntu-latest
# Empty for the Ubuntu entries: those run directly on the runner
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
include:
# 3.9 is the RHEL 9 system python used at JLab. AlmaLinux 9 gives the real
# platform (python 3.9, SQLite 3.34, pip 21.3); setup-python has no 3.9 for new Ubuntu.
- python-version: "3.9"
container: almalinux:9
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
if: ${{ !matrix.container }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Set up the system Python in a virtual environment
if: ${{ matrix.container }}
run: |
dnf -y install python3
python3 -m venv /opt/venv
echo /opt/venv/bin >> "$GITHUB_PATH"
# The web extra (Flask) is needed by the web GUI unit tests
- name: Install ccdb
run: pip install ".[web]"
- name: Run unit tests
working-directory: python
run: >
python -m unittest
tests.unit_test_authentication
tests.unit_test_cli_context
tests.unit_test_cli_gui
tests.unit_test_connection_secrets
tests.unit_test_dump_comments
tests.unit_test_exceptions
tests.unit_test_path_utils
tests.unit_test_utility_argument_parse
tests.unit_test_version
tests.unit_test_provider_attach
tests.unit_test_provider_disconnect
tests.unit_test_provider_lookups
tests.unit_test_webgui
tests.unit_test_webgui_assignments
tests.unit_test_webgui_escaping
tests.unit_test_webgui_fragments
tests.unit_test_webgui_prefix
tests.unit_test_webgui_queries
tests.unit_test_webgui_compare
# SQLite integration tests create their own database
# (via ccdb.testing.recreate_test_sqlite_db) - no fixture files needed
- name: Run SQLite integration tests
working-directory: python
run: >
python -m unittest
tests.integ_test_provider_sqlite
tests.integ_test_cli_manager
# Builds its own small SQLite databases in a temporary directory
- name: Run shallow copy script tests
run: python -m unittest discover -s scripts/shallow_copy
- name: CLI entry point smoke
run: |
ccdb --version
ccdb help