-
Notifications
You must be signed in to change notification settings - Fork 4
104 lines (92 loc) · 2.73 KB
/
measure-and-store-test-durations.yml
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
95
96
97
98
99
100
101
102
103
104
name: Measure and store test durations for pytest-split
on:
workflow_dispatch: # allow to run manually
schedule:
- cron: '0 6 * * 1' # run once a week on monday morning
jobs:
build:
runs-on: ubuntu-24.04
# we always use the latest container from the master branch
# this is fine because we still run all our installs just in case
container:
image: ghcr.io/onegov/onegov-cloud:master
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
shell: bash
steps:
- name: Install packages
run: |
apt-get update
apt-get install -y \
wget \
apparmor \
curl \
git-core \
postgresql \
redis \
openjdk-8-jre-headless \
gcc \
libc-dev \
fonts-liberation \
libappindicator3-1 \
libasound2t64 \
libdrm2 \
libgbm1 \
libnspr4 \
libnss3 \
libu2f-udev \
libvulkan1 \
libx11-xcb1 \
libxcb-dri3-0 \
libxshmfence1 \
libxss1 \
unzip \
xdg-utils
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
with:
# FIXME: OGC-1857
chrome-version: 127
install-chromedriver: true
- name: Checkout repo
uses: actions/checkout@v4
- name: Install dependencies
run: |
source /app/bin/activate
python -m pip install --upgrade uv
uv pip install pytest-split
# TEMPORARY: editable build so we don't need a path-fix in codecov
uv pip install -e .[test]
env:
# NOTE: Suppress uv warning
UV_LINK_MODE: copy
- name: Prepare test environment
run: |
# reset the build asset permissions
# TEMPORARY: if we no longer do an editable install, then the base
# path needs to change to /app/lib/
find . -type d -iname assets -print0 | xargs -0 chmod a+w -R
# add unprivileged test user
adduser --disabled-password --gecos "" test
redis-server --daemonize yes
# NOTE: Allow the test user to write to this file
chown test .test_durations
- name: Measure test durations
run: |
run-as "$(id -u test)":test /app/bin/pytest \
-o cache_dir=/tmp/pytest \
--store-durations \
tests
env:
LC_ALL: C.UTF-8
LANG: C.UTF-8
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64
SKIP_DRIVER_MANAGER: '1'
- uses: EndBug/add-and-commit@v9
with:
add: .test_durations
default_author: github_actions
message: Updates test durations [skip-ci]