Repository navigation
Skip worker dispatch in v2 tests and share completed fixtures - #231
Merged
Merged
Conversation
Every v2 test request now sends X-FastFuels-Skip-Dispatch: 1, so create tests store their resource without starting a prod worker job. Tests that wait on a job or read its results request the real_dispatch fixture, and fixtures that build completed resources create them inside real_dispatch_client(). Refs #230
Session fixtures now provide one voxel grid (DUET, LeafLux, Fosberg and QUIC-Fire), one topography grid on its lattice (Fosberg and QUIC-Fire), one inventory CSV export and one 3DEP point cloud to every module. The shared topography grid moves to 30 m so the landscape export reuses it, LeafLux and Fosberg share one irradiance grid, and the two inventory apply tests share one completed duplicate. Refs #230
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.
Closes #230
The v2 tests run against the prod API, and every create used to start a real worker job. The API now accepts
X-FastFuels-Skip-Dispatch: 1(silvxlabs/FastFuels-API-v2#681): a request carrying it stores the resource but queues no job. This PR makes the header the default in the v2 tests, and has the tests that need real jobs share completed fixtures.Real jobs per full
pytest v2run: about 105 → 47.Changes
Only
tests/v2/changes. The public SDK, the generatedclient_libraryand CI are unchanged, and no release is needed.1. Create-only tests skip dispatch
tests/v2/utils.py:install_skip_dispatch_client()swaps the SDK's cached client for a copy that carries the header and keeps a header-free copy.real_dispatch_client()is a context manager that switches to the header-free client.tests/v2/conftest.py: the session autouse fixtureskip_dispatch_by_defaultinstalls the header client for every test.*_requires_completed*guard test. Those tests are now guaranteed to see apendingresource.2. Tests that need real jobs opt in and share completed fixtures
A test that waits on a job or reads its results requests the
real_dispatchfixture. Fixtures that build completed resources create them insidereal_dispatch_client().New shared fixtures:
completed_voxel_grid(2 m × 1 m; foliage bulk density,spcd, live moisture, LAD)completed_voxel_topography_gridcompleted_inventory_csv_exporttest_exportsandtest_inventoriescovered_3dep_domain/completed_3dep_point_cloud(moved to conftest)test_gridscompleted_leaflux_irradiance_grid(module)completed_throwaway_inventory(module)Tests that still start their own job test a distinct job type or option:
Please review
completed_throwaway_inventoryis shared and mutable. The modifications and treatments apply tests re-derive the same duplicate in turn. Each checks only its own ledger, so they pass in either order, but if the first one fails and leaves the inventory failed, the second fails too.completed_topography_gridchanges from 10 m with default bands to 30 m with explicit elevation, slope and aspect, so the landscape export can reuse it. Every test that reads it passes.Verification
pendingafter 45 s.pytest v2run: 469 passed, 1 skipped (the existing NetCDF skip).