I'm using `python_tests`, but some of my unittests...
# general
w
I'm using
python_tests
, but some of my unittests require assets from s3. I'm seeking for advice on how this should be implemented. For instance, could I use a target such as
experimental_shell_command
to run shell
aws s3 sync <s3://bucket/> ./test_assets/
prior to my tests ? Then how can I make the content of
./test_assets
available to my unittests ? Would be
./test_assets
cached somewhere or entirely re-fetched for every execution ?
h
w
sounds like an option, but in that case (using aws s3 as a storage unit) I would need to make all my assets publicly available to be accessible via https. Alternatively I could implement a pytest fixture to download all my assets using boto3, but I was wondering if there would be an easy way to do it with Pants. Ideally I’d like to download my assets once and re-use it across different projects in same repo.
b
I think your approach is sound. AFAIK The result would be cached locally and would be invalidated if the command or underlying binary changed.
To make the files appear in the sandbox, declare a dependency between the test target and your command target