Skip to content

Commit e5200f5

Browse files
committed
Use consistent naming and paths for test folders.
1 parent 0eabc35 commit e5200f5

File tree

2 files changed

+33
-26
lines changed

2 files changed

+33
-26
lines changed

.github/workflows/ci.yaml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
strategy:
9090
fail-fast: false
9191
matrix:
92-
target: ['macOS', 'iOS', 'tvOS', 'watchOS', 'visionOS']
92+
platform: ['macOS', 'iOS', 'tvOS', 'watchOS', 'visionOS']
9393

9494
steps:
9595
- uses: actions/[email protected]
@@ -104,29 +104,29 @@ jobs:
104104
# It's an edge case, but when a new alpha is released, we need to use it ASAP.
105105
check-latest: true
106106

107-
- name: Build ${{ matrix.target }}
107+
- name: Build ${{ matrix.platform }}
108108
run: |
109-
# Do the build for the requested target.
110-
make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
109+
# Do the build for the requested platform.
110+
make ${{ matrix.platform }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }}
111111
112112
- name: Upload build artefacts
113113
uses: actions/[email protected]
114114
with:
115-
name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
116-
path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
115+
name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
116+
path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
117117

118118
briefcase-testbed:
119-
name: Briefcase testbed (${{ matrix.target }})
119+
name: Briefcase testbed (${{ matrix.platform }})
120120
runs-on: macOS-latest
121121
needs: [ config, build ]
122122
strategy:
123123
fail-fast: false
124124
matrix:
125-
target: ["macOS", "iOS"]
125+
platform: ["macOS", "iOS"]
126126
include:
127127
- briefcase-run-args:
128128

129-
- target: iOS
129+
- platform: iOS
130130
briefcase-run-args: ' -d "iPhone SE (3rd generation)"'
131131

132132
steps:
@@ -135,7 +135,7 @@ jobs:
135135
- name: Get build artifact
136136
uses: actions/[email protected]
137137
with:
138-
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
138+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
139139
path: dist
140140
merge-multiple: true
141141

@@ -162,24 +162,24 @@ jobs:
162162
- name: Run support testbed check
163163
timeout-minutes: 10
164164
working-directory: Python-support-testbed
165-
run: briefcase run ${{ matrix.target }} Xcode --test ${{ matrix.briefcase-run-args }} -C support_package=\'../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz\'
165+
run: briefcase run ${{ matrix.platform }} Xcode --test ${{ matrix.briefcase-run-args }} -C support_package=\'../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz\'
166166

167167
cpython-testbed:
168-
name: CPython testbed (${{ matrix.target }})
168+
name: CPython testbed (${{ matrix.platform }})
169169
runs-on: macOS-latest
170170
needs: [ config, build ]
171171
strategy:
172172
fail-fast: false
173173
matrix:
174-
target: ["iOS", "visionOS"]
174+
platform: ["iOS", "visionOS"]
175175

176176
steps:
177177
- uses: actions/[email protected]
178178

179179
- name: Get build artifact
180180
uses: actions/[email protected]
181181
with:
182-
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
182+
pattern: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
183183
path: dist
184184
merge-multiple: true
185185

@@ -195,13 +195,13 @@ jobs:
195195

196196
- name: Unpack support package
197197
run: |
198-
mkdir support
199-
cd support
200-
tar zxvf ../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
198+
mkdir -p support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
199+
cd support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
200+
tar zxvf ../../../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
201201
202202
- name: Run CPython testbed
203203
timeout-minutes: 10
204-
working-directory: support
204+
working-directory: support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
205205
run: |
206206
# Run a representative subset of CPython core tests:
207207
# - test_builtin as a test of core language tools
@@ -251,19 +251,25 @@ jobs:
251251

252252
- name: Unpack support package
253253
run: |
254-
mkdir support
255-
cd support
256-
tar zxvf ../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
254+
mkdir -p support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
255+
cd support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}
256+
tar zxvf ../../../dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.platform }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz
257257
258258
- name: Run cross-platform environment test
259259
env:
260260
PYTHON_CROSS_PLATFORM: ${{ matrix.platform }}
261261
PYTHON_CROSS_SLICE: ${{ matrix.slice }}
262262
PYTHON_CROSS_MULTIARCH: ${{ matrix.multiarch }}
263263
run: |
264+
# Create and activate a native virtual environment
264265
python${{ needs.config.outputs.PYTHON_VER }} -m venv cross-venv
265266
source cross-venv/bin/activate
267+
268+
# Install pytest
266269
python -m pip install pytest
270+
267271
# Convert venv into cross-venv
268-
python support/Python.xcframework/${{ matrix.slice }}/platform-config/${{ matrix.multiarch }}/make_cross_venv.py cross-venv
272+
python support/${{ needs.config.outputs.PYTHON_VER }}/${{ matrix.platform }}/Python.xcframework/${{ matrix.slice }}/platform-config/${{ matrix.multiarch }}/make_cross_venv.py cross-venv
273+
274+
# Run the test suite
269275
python -m pytest tests

tests/test_cross_env.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
PYTHON_CROSS_SLICE = os.getenv("PYTHON_CROSS_SLICE", "unknown")
1313
PYTHON_CROSS_MULTIARCH = os.getenv("PYTHON_CROSS_MULTIARCH", "unknown")
1414

15-
# Determine some file system anchor points.
15+
# Determine some file system anchor points for the tests
16+
# Assumes that the tests are run in a virtual environment named
17+
# `cross-venv`,
1618
VENV_PREFIX = Path(__file__).parent.parent / "cross-venv"
19+
default_support_base = f"support/{sys.version_info.major}.{sys.version_info.minor}/{PYTHON_CROSS_PLATFORM}"
1720
SUPPORT_PREFIX = (
1821
Path(__file__).parent.parent
19-
/ "support"
20-
/ f"{sys.version_info.major}.{sys.version_info.minor}"
21-
/ PYTHON_CROSS_PLATFORM
22+
/ os.getenv("PYTHON_SUPPORT_BASE", default_support_base)
2223
/ "Python.xcframework"
2324
/ PYTHON_CROSS_SLICE
2425
)

0 commit comments

Comments
 (0)