-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (84 loc) · 2.99 KB
/
test-e2e.yml
File metadata and controls
94 lines (84 loc) · 2.99 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
85
86
87
88
89
90
91
92
93
94
name: End-to-End Test
on:
workflow_call:
inputs:
new-release-detected:
required: true
type: string
distribution-artifacts-name:
required: true
type: string
distribution-artifacts-dir:
required: true
type: string
package-name:
required: true
type: string
distribution-file-incipit:
required: true
type: string
test-dependency-group:
required: true
type: string
run-test-command:
required: true
type: string
jobs:
test-e2e:
name: End-to-End Test
runs-on: ubuntu-latest
env:
APP_CONSOLE_LOG: "e2e-test-app-stderr.log"
APP_FILE_LOG: "e2e-test-logfile.log"
APP_FILE_LOG_ROOT: "e2e-test-logfile_root.log"
APP_EXPECTED_LOG_LINES: 3
steps:
- !step
name: Setup | Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.sha }}
fetch-depth: 1
- !step
name: Setup | Download Distribution Artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
if: ${{ inputs.new-release-detected == 'true' }}
id: artifact-download
with:
name: ${{ inputs.distribution-artifacts-name }}
path: ${{ inputs.distribution-artifacts-dir }}
- !step
name: Setup | Install Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: .python-version
- !step
name: Setup | Install uv
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
- name: Setup | Install Project Dependencies for Test
env:
UV_NO_MANAGED_PYTHON: true
run: uv sync --group ${{ inputs.test-dependency-group }}
- name: Setup | Install distribution artifact
if: ${{ steps.artifact-download.outcome == 'success' }}
run: |
uv pip uninstall ${{ inputs.package-name }}
uv pip install ${{ inputs.distribution-artifacts-dir}}/${{ inputs.distribution-file-incipit }}-*.whl
- name: Test | Run pytest
run: ${{ inputs.run-test-command }}
- name: Test | Run End-to-End App Test
run: ./tests/e2e_test_app.py 2>"$APP_CONSOLE_LOG"
- name: Test | Check End-to-End Test Results
run: |
cat -vET "$APP_CONSOLE_LOG"
echo "Lines in $APP_CONSOLE_LOG: $(wc -l < $APP_CONSOLE_LOG)"
echo "Lines in $APP_FILE_LOG: $(wc -l < $APP_FILE_LOG)"
echo "Size of $APP_FILE_LOG_ROOT: $(wc -c < $APP_FILE_LOG_ROOT)"
if [ "$(wc -l < $APP_CONSOLE_LOG)" -eq $APP_EXPECTED_LOG_LINES ] && \
[ "$(wc -l < $APP_FILE_LOG)" -eq $APP_EXPECTED_LOG_LINES ] && \
[ ! -s "$APP_FILE_LOG_ROOT" ]; then
echo "All checks passed."
else
echo "Test condition failed."
exit 1
fi