Skip to content

BUILD: Name each fetched data file before the Python tests run - #281

Draft
jwrosewell wants to merge 2 commits into
rcfrom
ci/examples-use-fetched-data-files
Draft

jwrosewell wants to merge 2 commits into
rcfrom
ci/examples-use-fetched-data-files

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

The IP Intelligence on-premise tests read the data file named in _51DEGREES_IPI_PATH, and the device detection web getting started example reads _51DEGREES_DD_PATH. In CI the IP Intelligence fetch script wrote its variable where the tests in the same step could not see it, and nothing named the device detection file. Each fetch script now names the file it has just fetched, in the process the tests run in.

What changes

  • ip-intelligence/ci/fetch-assets.ps1 sets _51DEGREES_IPI_PATH with $env: to the Lite data file it fetched, 51Degrees-LiteIpiV41.ipi. common-ci runs this script and the tests in one step, so the IP Intelligence on-premise tests read it. The IP Intelligence examples take the variable only when it names the file they ask for, 51Degrees-LiteV41.ipi, so they still find the Lite file through the link the script makes under that name in cxx/data/ip-intelligence.
  • device-detection/ci/fetch-assets.ps1 sets _51DEGREES_DD_PATH to the Lite data file it fetched, which the web getting started example reads. The examples that look for their file with find_file do not read the variable, and find the file through the link the script makes in cxx/data/device-detection.
  • ip-intelligence/ci/fetch-assets.ps1 also fetches the device detection Lite data file and links it into ip-intelligence/assets, where the mixed examples find it. It sets _51DEGREES_DD_PATH too, which no IP Intelligence example or test reads.
  • The free-threaded test step in .github/workflows/free-threaded-python.yml sets both variables to the Lite files it restores from its cache.
  • ci/key-names.Tests.ps1 and ci/free-threaded-python.Tests.ps1 check each of these.

What a person running the examples gets is unchanged.

Tests

  • ci/key-names.Tests.ps1 and ci/free-threaded-python.Tests.ps1 with Pester 5.7.1 on Windows all pass, and each new or changed test fails against the scripts as they were.
  • Every ci/*.Tests.ps1 on Windows: 453 passed, 0 failed, at the second commit, which names the Lite file. Its new test, that the script names the Lite file it fetched, failed at the first commit.
  • Not run: the GitHub Actions jobs, pytest, and the native builds.

Before this leaves draft

Not ready to merge until these are done.

  1. The Pull Requests run at this head, which has not run yet, so no check here runs the two fetch scripts under common-ci.
  2. The free-threaded run passes at this head. It did at the first commit, in run 45461790754, on Python 3.13t on Ubuntu, 3.14t on Ubuntu and 3.14t on Windows.
  3. Whether ip-intelligence/ci/fetch-assets.ps1 still fetches the Enterprise file (about 2.3 GB), as no test reads it now, or one test names it.

ip-intelligence/ci/fetch-assets.ps1 sets _51DEGREES_IPI_PATH to the
Enterprise data file it fetched, with $env:, so the tests that common-ci
runs in the same process read it. device-detection/ci/fetch-assets.ps1
sets _51DEGREES_DD_PATH to the Lite data file it fetched.

The IP Intelligence fetch script also fetches the device detection Lite
file, which the mixed examples use, and names it in _51DEGREES_DD_PATH,
so it is there when only IP Intelligence is tested. The free-threaded
test step sets both variables to the Lite files it restores from its
cache.

The key names and free-threaded Pester tests check each of these. What
a person running the examples gets is unchanged.
ip-intelligence/ci/fetch-assets.ps1 named the Enterprise data file in
_51DEGREES_IPI_PATH, and the tests and examples accept the free Lite
file, which the script already fetches. It now names the Lite file, and
a new test in ci/key-names.Tests.ps1 checks that it does. The test that
the script still asks common-ci for the Enterprise file stays, although
nothing reads that file now, and an example test comment that said CI
names the Enterprise file is corrected.
@jwrosewell jwrosewell mentioned this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant