lively-garden-66504
12/04/2023, 10:20 PMpytest.main('./tests')
where it's located under dir/
from the repo root. I tried to get this to work via pants run dir:runner-target
but it doesn't work because pytest can't find that directory. cd dir && pants run :runner-target
also doesn't work.
So I included files(sources=["**"])
as a dependency to the Pex target. pants dependencies dir/tests_runner.py
shows that all files targets are includes as deps. But running the Pex still doesn't work in any case. So a ran with --preserve-sandboxes=always
and went inside the sandbox. I see dir/test_runner.py
instead, but nothing else in the directory.curved-television-6568
12/04/2023, 10:23 PMfiles
are silently ignored.lively-garden-66504
12/04/2023, 10:26 PMlively-garden-66504
12/04/2023, 10:26 PMcurved-television-6568
12/04/2023, 10:27 PMcurved-television-6568
12/04/2023, 10:28 PMlively-garden-66504
12/04/2023, 10:29 PMcurved-television-6568
12/04/2023, 10:29 PMresource
target for it.curved-television-6568
12/04/2023, 10:30 PMlively-garden-66504
12/04/2023, 10:56 PMresources(name="test_files", sources=["**"])
❯ tree
.
├── __run.sh
├── dir
│ ├── __pycache__
│ │ └── tests_runner.cpython-311.pyc
│ └── tests_runner.py
├── root.pex
│ ├── PEX-INFO
│ ├── __main__.py
│ └── __pex__
│ └── __init__.py
├── root.pex_bin_python_shim.sh
└── root.pex_pex_shim.sh
lively-garden-66504
12/04/2023, 10:57 PM/dir
in this caselively-garden-66504
12/04/2023, 11:31 PMdir/tests:tests
as a dependency and then run pytest.main("./e2e_testing/tests")
from the test runner.
I actually think this is a better solution than using resources. I'll keep it this way, although I think the behavior of resources / files here is not what you'd expect.