Repository navigation
BUILD: Name each fetched data file before the Python tests run - #281
Draft
jwrosewell wants to merge 2 commits into
Draft
jwrosewell wants to merge 2 commits into
jwrosewell wants to merge 2 commits into
Conversation
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.
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ps1sets_51DEGREES_IPI_PATHwith$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 incxx/data/ip-intelligence.device-detection/ci/fetch-assets.ps1sets_51DEGREES_DD_PATHto the Lite data file it fetched, which the web getting started example reads. The examples that look for their file withfind_filedo not read the variable, and find the file through the link the script makes incxx/data/device-detection.ip-intelligence/ci/fetch-assets.ps1also fetches the device detection Lite data file and links it intoip-intelligence/assets, where the mixed examples find it. It sets_51DEGREES_DD_PATHtoo, which no IP Intelligence example or test reads..github/workflows/free-threaded-python.ymlsets both variables to the Lite files it restores from its cache.ci/key-names.Tests.ps1andci/free-threaded-python.Tests.ps1check each of these.What a person running the examples gets is unchanged.
Tests
ci/key-names.Tests.ps1andci/free-threaded-python.Tests.ps1with Pester 5.7.1 on Windows all pass, and each new or changed test fails against the scripts as they were.ci/*.Tests.ps1on 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.Before this leaves draft
Not ready to merge until these are done.
ip-intelligence/ci/fetch-assets.ps1still fetches the Enterprise file (about 2.3 GB), as no test reads it now, or one test names it.