tall-jelly-41236
05/15/2022, 4:01 AMpytest-bdd, My feature files are not accessible, and I have tried as python_test_utils and files and included them in dependencies for python_test, still no luck,. I am facing file not found issue for /private/tmp/.tmpBDSdib/tests/bdd/features/integration_instance.feature I am sure its very small thing I am missing, hope some one can help me here.rhythmic-morning-87313
05/15/2022, 9:22 AMrhythmic-morning-87313
05/15/2022, 9:23 AMbitter-ability-32190
05/15/2022, 11:21 AMbitter-ability-32190
05/15/2022, 11:24 AMruntime_package_dependencies is for package-able things, for assets you'll just use dependencieshappy-kitchen-89482
05/15/2022, 2:48 PMfiles(name="features", sources=["*.feature"]) and then have the python_tests() target explicitly depend on that target.happy-kitchen-89482
05/15/2022, 2:49 PMos, rather than loading them as a resource via pkgutil, so a files() target is the way to go)bitter-ability-32190
05/15/2022, 2:52 PMtest the distinction between the two is a bit arbitrary as the file should be on disk in the same place either way. It matters more for packaged code.
You do need the target either way though, and files is likely "more correct"happy-kitchen-89482
05/15/2022, 2:54 PMhappy-kitchen-89482
05/15/2022, 2:54 PMbitter-ability-32190
05/15/2022, 2:55 PMtall-jelly-41236
05/15/2022, 3:49 PMpython_requirements(
name="connector-requirements.txt",
source="requirements.txt",
)
python_sources(name="sources",
dependencies=[
"packages/connector-common:sources",
"packages/connector-auth:sources",
":connector-requirements.txt"]
)
files(
name="features",
sources=["tests/bdd/feature/*.feature"]
)
python_test_utils(
name="test_utils",
sources=["tests/bdd/test/conftest.py"],
)
python_tests (
name="tests",
dependencies=[":sources",":features"],
sources=["tests/**/test_*.py"]
)
@happy-kitchen-89482 your right this is using os. option instead of filesbitter-ability-32190
05/15/2022, 3:49 PMbitter-ability-32190
05/15/2022, 3:50 PMpython_test_utils or inference for which sources your tests depend on?tall-jelly-41236
05/15/2022, 3:51 PMhappy-kitchen-89482
05/15/2022, 3:51 PMhappy-kitchen-89482
05/15/2022, 3:52 PMfiles() target etc?bitter-ability-32190
05/15/2022, 3:52 PMBUILD looks right, so next step would be to run your test file with --no-process-cleanup (e.g. ./pants --no-process-cleanup test path/to/test.py). It will log and leak the sandbox directory, then you can poke and ensure the files are there in the right placehappy-kitchen-89482
05/15/2022, 3:52 PM":features" dependency should put all the features files in the sandbox that pytest runs inhappy-kitchen-89482
05/15/2022, 3:52 PMbitter-ability-32190
05/15/2022, 3:53 PMpeek and dependencies to ensure Pants is still doing the right thing)happy-kitchen-89482
05/15/2022, 3:53 PMtall-jelly-41236
05/15/2022, 3:53 PM--no-process-cleanup should give me the hint on the folder structure to fix my pathtall-jelly-41236
05/15/2022, 3:53 PMtall-jelly-41236
05/15/2022, 6:11 PMfiles option.happy-kitchen-89482
05/15/2022, 7:45 PMbitter-ability-32190
05/15/2022, 7:48 PM./pants list to see if it lists those files) or the plugin expects them at a different pathtall-jelly-41236
05/15/2022, 8:34 PM./pants list packages/connector-apis: | grep "features"
packages/connector-apis:features
i can see target, but not the actual .feature filesbitter-ability-32190
05/15/2022, 8:35 PMtall-jelly-41236
05/15/2022, 8:35 PMbitter-ability-32190
05/15/2022, 8:38 PMtall-jelly-41236
05/15/2022, 8:42 PMgit ignoredtall-jelly-41236
05/15/2022, 8:42 PMgit status trigger_process_metadata.feature
On branch develop
Your branch is up to date with 'origin/develop'.
nothing to commit, working tree cleantall-jelly-41236
05/15/2022, 8:45 PMtall-jelly-41236
05/15/2022, 8:46 PMfeatures not feature that s caused this confusiontall-jelly-41236
05/15/2022, 8:47 PMfiles target and including in the dependenciesbitter-ability-32190
05/15/2022, 8:48 PMtall-jelly-41236
05/15/2022, 8:50 PMhappy-kitchen-89482
05/15/2022, 9:57 PM