Skip to content

Artifacts generated during astro dev pytest are not available after tests have finished #2066

@jtrobles-cdd

Description

@jtrobles-cdd

Describe the bug

We store artifacts generated during testing in include/ so that they can be accessed from outside the astro-pytest container after astro dev pytest has finished. This is documented in the official documentation, and worked fine until recently.

The console output for versions that are not affected by the bug (1.40.0, 1.39.0, 1.38.1) looks like:

$ astro dev pytest --args '--junit-xml=include/pytest_report.junit.xml'

Running your test suite…
✔ Project image has been updated
[...]
Astro Runtime Version: 3.1-14
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.0.2, pluggy-1.6.0
rootdir: /usr/local/airflow
configfile: pytest.ini
plugins: cov-6.2.1, anyio-4.12.1
collected 2 items
[...]
---- generated xml file: /usr/local/airflow/include/pytest_report.junit.xml ----
======================= 2 passed, 38 warnings in 20.23s ========================

✔ All tests passed!
$ file include/pytest_report.junit.xml

include/pytest_report.junit.xml: XML 1.0 document, ASCII text, with very long lines (543), with no line terminators

The console output for the version that is affected looks like:

$ astro dev pytest --args '--junit-xml=include/pytest_report.junit.xml'

Running your test suite…
✔ Project image has been updated
[...]
Astro Runtime Version: 3.1-14
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.0.2, pluggy-1.6.0
rootdir: /usr/local/airflow
configfile: pytest.ini
plugins: cov-6.2.1, anyio-4.12.1
collected 2 items
[...]
---- generated xml file: /usr/local/airflow/include/pytest_report.junit.xml ----
======================= 2 passed, 38 warnings in 19.50s ========================

✔ All tests passed!
$ file include/pytest_report.junit.xml

include/pytest_report.junit.xml: cannot open `include/pytest_report.junit.xml' (No such file or directory)

What CLI Version did you experience this bug?

1.40.1

This CLI bug is related to which Astronomer Platform?

  • Astro
  • Software
  • None/Unknown

What Operating System is the above CLI installed on?

Ubuntu 22.04.5 LTS

🪜 Steps To Reproduce

  1. Run astro dev pytest --args '--junit-xml=include/pytest_report.junit.xml'
  2. Run ls -al include/pytest_report.junit.xml.

📸 Screenshots

Not applicable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions