Repository navigation
109 lines (100 loc) · 4.99 KB
/
Copy pathci-scripts.yml
File metadata and controls
109 lines (100 loc) · 4.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Script tests
# Unit tests for the helper scripts in .github/scripts that gate CI decisions
# (e.g. schema-impact narrowing). Without this, a regression in the narrowing
# logic could silently skip affected product tests.
on:
pull_request:
paths:
- .github/scripts/**
- .github/auto-assign-labels.json
- .github/workflows/ci-scripts.yml
- .github/actions/setup-uv/**
# trunk-impacted-targets.test.js reads proto/ and fails on a tree the
# table does not declare, so adding one has to run these tests.
- proto/**
# turbo-discover.test.js pins the Django segment table to these.
- .github/workflows/ci-backend.yml
- .depot/workflows/ci-backend.yml
# The backend test selector and its verdict script gate ci-backend.
- tools/snob_backend_test_selection_shadow.py
- tools/test_snob_backend_test_selection_shadow.py
- tools/test_selection_verdict.py
- tools/test_test_selection_verdict.py
# test_tach_map.py holds tach_map.py's pin to the locked tach version,
# and a routine dependency bump is what moves it.
- uv.lock
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
script-tests:
name: .github/scripts unit tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
# The tests take seconds, so a full checkout of the monorepo dominated
# the job. Check out only the trees the suite reads: most tests are
# pure logic over path strings, but a few read the real repo to guard
# against drift — trunk-impacted-targets.test.js walks proto/, rust/,
# nodejs/ and every workspace package.json (the unanchored pattern
# pulls each manifest without its source tree), and
# report_test_timings imports tools/owners and finds the root by
# owners.yaml. A new test that reads another path must add it here.
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
sparse-checkout: |
/.github/
/bin/render-jest-timings-example
/bin/report-jest-timings
/.depot/
/tools/
/proto/
/rust/
/nodejs/
/posthog/personhog_client/
/.semgrep/
/frontend/bin/ci-report/
/products/README.md
/services/README.md
/.nvmrc
/owners.yaml
/pnpm-workspace.yaml
/uv.lock
/tach.toml
/pyproject.toml
package.json
sparse-checkout-cone-mode: false
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: .nvmrc
- name: Install uv
uses: ./.github/actions/setup-uv
with:
enable-cache: false
# The preinstalled python3 runs these standalone tests, so no
# setup-python step. defusedxml + opentelemetry + tools/owners are
# report_test_timings.py's script deps.
- name: Install pytest
run: python3 -m pip install --quiet pytest parameterized defusedxml==0.7.1 opentelemetry-sdk==1.33.1 opentelemetry-exporter-otlp-proto-http==1.33.1 ./tools/owners
# `-c /dev/null` skips the repo pytest.ini (its --reuse-db addopt needs
# pytest-django, which we don't install here). `--noconftest` skips the
# root conftest.py, whose autouse fixtures import the posthog package
# (and thus Django) — not installed in this lightweight job. The tools/
# files stay explicit: a tools glob would double-run the dagster and
# playwright selection tests (they run in ci-dagster and
# ci-e2e-playwright) and collect test_selection_verdict.py, which is
# the script under test, not a test.
- name: Python script tests
run: |
python3 -m pytest -v -c /dev/null -p no:cacheprovider --noconftest \
.github/scripts/test_*.py \
tools/test_snob_backend_test_selection_shadow.py \
tools/test_test_selection_verdict.py
# schema-impact.test.js shells out to schema_usage_scan.py via the same
# preinstalled python3.
- name: Node script tests
run: node --test .github/scripts/*.test.js .github/scripts/*.test.mjs