fix: resolve stellar_asset_id import error in data-processing CI#1012
Open
olalois wants to merge 1 commit into
Open
fix: resolve stellar_asset_id import error in data-processing CI#1012olalois wants to merge 1 commit into
olalois wants to merge 1 commit into
Conversation
The test job was failing because tests/conftest.py added apps/data-processing/src to sys.path instead of the project root (apps/data-processing), making 'from src.ingestion...' imports unresolvable. Changes: - tests/conftest.py: insert apps/data-processing root onto sys.path (was incorrectly inserting the src/ subdir) - pytest.ini: add pythonpath = . so pytest 7+ natively adds the working directory to sys.path in CI - src/ingestion/__init__.py: export stellar_asset_id symbols (KNOWN_ASSETS, NATIVE_KEY, AssetID, make_asset_key, parse_asset_key, normalize_asset_dict, display_name) All 52 tests in test_stellar_asset_id.py now pass.
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.
Summary
Fixes the failing
test_stellar_asset_id.pytest job in the data-processing CI workflow.Root Cause
tests/conftest.pywas insertingapps/data-processing/srcontosys.pathinstead of the project root (apps/data-processing). Because all test files usefrom src.ingestion.xxx import ...style imports, Python needs the parent ofsrcon the path — notsrcitself.Changes
tests/conftest.pysys.path.insertto point to the data-processing root (..) instead of../srcpytest.inipythonpath = .— pytest 7+ native feature that ensures the working directory is always onsys.pathin CI (already requirespytest>=7.0.0inrequirements.txt)src/ingestion/__init__.pystellar_asset_idsymbols (KNOWN_ASSETS,NATIVE_KEY,AssetID,make_asset_key,parse_asset_key,normalize_asset_dict,display_name) from the package public APIVerification
All 52 tests in
tests/test_stellar_asset_id.pypass locally.Closes #