-
-
Notifications
You must be signed in to change notification settings - Fork 436
133 lines (112 loc) · 5.23 KB
/
Copy pathtest-smoketests.yml
File metadata and controls
133 lines (112 loc) · 5.23 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: smoketests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch: # manual execution
# Cancel any in-flight runs for the same PR / branch when a new push arrives.
# Master pushes still run to completion (the ``cancel-in-progress`` predicate
# only fires on PR events).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
smoketests:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
# fail-fast: any matrix entry failure cancels the rest. Trades
# full-coverage-on-failure for faster feedback and lower CI burn —
# if Windows 3.10 spawn-pool flakes we want to know within seconds,
# not 30 minutes later after every other combo finishes.
fail-fast: true
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python: [ '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: |
requirements.txt
pyproject.toml
- name: Work around arm64 support on MacOS
# https://github.com/actions/virtual-environments/issues/2557
if: matrix.os == 'macos-latest'
run: sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install numpy
- name: Build scalene
run: pip -v install -e .
# Steps are ordered fail-fast: the most failure-prone smoketests run
# first so a broken build surfaces in seconds, not minutes. Cheap
# always-passing checks come last as smoke for the lifecycle bits.
# NOTE: This test verifies that spawn-mode Pool.map completes under
# Scalene without hanging (regression test for #998). Most flake-prone:
# multiprocessing resource tracker + spawn workers + signal handlers
# all interact during shutdown.
- name: multiprocessing spawn pool smoke test
run: python test/smoketest_pool_spawn.py
timeout-minutes: 5
# Regression test for pytest-xdist + --profile-all on Linux (issue
# #1022). The bug was Linux-specific: execnet worker subprocesses
# inherited a sigmask with Scalene's CPU sampling signal blocked,
# so the timer fired but the handler never ran and the user's code
# was absent from the merged profile. The smoketest itself self-
# skips on non-Linux platforms.
- name: pytest-xdist + --profile-all (issue #1022)
if: matrix.os == 'ubuntu-latest'
run: python test/smoketest_issue_1022.py
timeout-minutes: 5
# Note: test/smoketest.py only handles single JSON, rather than multiple in sequence.
- name: profile-interval smoke test
run: python -m scalene run --profile-interval=2 test/testme.py && python -m scalene view --cli
timeout-minutes: 3
# NOTE: this is a regression test for signals not being
# restarted properly. It checks whether the program
# halts or runs forever, not for correctness of timing.
- name: signal smoketest
if: matrix.os != 'windows-latest'
run: python test/smoketest.py test/signal_test.py
timeout-minutes: 0.5
- name: multiprocessing smoke test
if: matrix.os != 'windows-latest'
run: python test/smoketest.py test/multiprocessing_test.py
# Regression test for https://github.com/plasma-umass/scalene/discussions/659.
# Uses --memory attribution; verifies that a numpy workload on a
# threading.Thread does not smear allocations onto the main thread's
# time.sleep line. The test self-skips its assertions if memory sampling
# produced zero samples on this runner (avoids flakes when signal timing
# prevents the allocator sampler from firing).
- name: issue #659 per-thread memory attribution
run: python test/smoketest_issue_659.py
# NOTE: The decorator smoke test relies on CPU signal sampling which
# doesn't work reliably on Windows CI (similar to the signal smoketest).
- name: decorator smoke test
if: matrix.os != 'windows-latest'
run: python test/smoketest_profile_decorator.py
- name: cpu-only smoke test
run: python test/smoketest.py test/testme.py --cpu-only
# Note: This test doesn't need to read an output,
# it is meant to determine if there is an ImportError
# or anything related if relative imports are used.
- name: -m invocation smoketest
run: |
python -m pip install git+https://github.com/sternj/import_stress_test
python -m scalene run --- -m import_stress_test && python -m scalene view --cli
- name: --off flag smoke test
# Verify that --off starts with profiling disabled and the program
# still runs to completion. This is the primary cross-platform test
# for the --on/--off lifecycle feature (issue #1009).
run: python -m scalene run --off --cpu-only test/testme.py
# FIXME: these tests are broken under the current Github runner
#
# - name: line invalidation test
# run: python test/smoketest_line_invalidation.py