ci: add stitch-models tests & integrate helper utility for test execution#24
ci: add stitch-models tests & integrate helper utility for test execution#24
stitch-models tests & integrate helper utility for test execution#24Conversation
AlexAxthelm
left a comment
There was a problem hiding this comment.
Actual test content looks good.
There was a problem hiding this comment.
The changes to the Makefile seem out of scope for "test stitch-models", and in general, I think it's a bit over-complicated for what we want.
I think my general tendency here would be (in a separate Makefile-cleaning PR) to change to something like test-python that would depend on test-stitch-models and test-api and all our other python testing commands (but with better target names), which would run their own exact installs
(but I'm still missing the advantages of that over just syncing the whole project)
There was a problem hiding this comment.
See comment on Makefile, but I think we want to keep this process simpler (i.e. not have this script)
|
Relates to STIT-176 |
|
I realize this is a bit mixed in scope, but it was a pretty quick change that I've been wanting for a little while. The 2 goals are:
My thoughts around this are that, in using a monorepo/workspace, getting properly isolated tests is a bit of a challenge. Additionally, as I mentioned in the description,
Whether we use the script in the makefile is less important, though I think it's really convenient to be able to run In a sense, it shifts the source of truth about dependencies and module/component/package relationships to the various |
AlexAxthelm
left a comment
There was a problem hiding this comment.
🤔 I see where you're coming from. Makes sense that it's necessary in a monorepo (again, I think it's my hesitance to that pattern that's showing).
There's still something off to me about this pattern, but I think I won't actually know what it is until I take a more holistic look at the Makefile.
In the meantime, works for me.
Summary
The PR updates our python testing Makefile targets to leverage a script instead of calling
uv run ...directly. It also updates the tests institch-modelsand integrates them into our CI (via the updated testing workflow).Rationale
Current test execution relies on first calling
uv sync --all-packages --dev. While this guarantees that all dependencies will appear in the virtual environment, it also hides errors if dependencies are not configured correctly within a member package. For example, ifstitch-apirelies on the newstitch-ogsipackage but fails to declare it in itspyproject.toml, tests will pass or we won't see errors sincestitch-ogsiwill be synced to the virtual environment.By leveraging the
--exactflag, we effectively sync each package individually and only test against explicitly declared dependencies.Added files
scripts/test-package.pyminimal executable python script that accepts a package argument and optional--exactflag, discovers member packages directories, and callsuv run --package <package name> --exact --group dev path/to/package_dirKey Changes
uv-testanduv-test-isolatedmake targets. Both support apkg=<package name>for running against a specific package and default to running all discovered tests.uv-testis useful for quick local testing, whileuv-test-isolatedis more robust and intended for use in out CItest-package.pyscriptAI
stitch-modelstest per latest package interface