fix: copy include/ artifacts back to host after astro dev pytest#2099
Open
tayloramurphy wants to merge 1 commit into
Open
fix: copy include/ artifacts back to host after astro dev pytest#2099tayloramurphy wants to merge 1 commit into
tayloramurphy wants to merge 1 commit into
Conversation
astronomer#2036 replaced the bind mounts in the pytest flow with a forward `docker cp` loop but never added a reverse copy, so files pytest writes to include/ (e.g. --junit-xml=include/pytest_report.junit.xml) stay stranded in the container. The astro-dev-pytest docs explicitly promise that artifacts in include/ are accessible after the test run. Copy the contents of include/. back from the container to the host after pytest finishes, skipping when the host include/ is absent so docker cp never fails on projects without the directory. Fixes astronomer#2066
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
astro dev pytestare not available after tests have finished #2066: afterastro dev pytestfinishes, files written toinclude/(e.g.--junit-xml=include/pytest_report.junit.xml) are once again accessible on the host.docker cploop but never added a reverse copy, so artifacts stayed stranded inside the container.include/is copied back, notdags/,tests/, orplugins/.Implementation notes
docker cp astro-pytest:/usr/local/airflow/include/. <airflowHome>/includerestores artifact visibility on the host.include/directory, sodocker cpnever errors on projects without one.rm) so an unexpectedcpfailure does not mask the real pytest exit code.Test plan
go test ./airflow/ -run 'TestAirflow/TestDockerImagePytest' -v -count=1— all existing pytest subtests pass, plus two new ones:copies include/ back to host after test run— asserts the reversecptargetsastro-pytest:/usr/local/airflow/include/.→<airflowHome>/includeand runs afterstart.skips reverse include/ copy when host include/ does not exist— asserts no reversecpis attempted when the host directory is absent.go test ./airflow/ -count=1— full airflow package passes.astro dev pytest --args '--junit-xml=include/pytest_report.junit.xml'followed byfile include/pytest_report.junit.xmlto confirm the artifact is present.