kind-traffic-20936
01/23/2025, 7:49 PMPANTS_REMOTE_CACHE_PREFIX="hello"
My other idea is to make everything depend on a file, and modify that file...fast-nail-55400
01/23/2025, 7:54 PMremote_environment
targets each with some different platform property. Then you could try putting put the relevant test in both environments.fast-nail-55400
01/23/2025, 7:54 PMkind-traffic-20936
01/23/2025, 7:55 PMPANTS_REMOTE_INSTANCE_NAME
could do this, but its not clear.kind-traffic-20936
01/23/2025, 7:55 PMfast-nail-55400
01/23/2025, 7:56 PMFrom reading the docs, I was under the impressionThe issue with two different instance names is that any build actions which did not depend on a database would not be shared between the two different runs.could do this, but its not clear.PANTS_REMOTE_INSTANCE_NAME
fast-nail-55400
01/23/2025, 7:57 PMlocal_environment
targets then with some differentiating dummy environment variable.fast-nail-55400
01/23/2025, 7:57 PMkind-traffic-20936
01/23/2025, 7:57 PMfast-nail-55400
01/23/2025, 7:58 PMfast-nail-55400
01/23/2025, 7:58 PMdb_common_test.py
, db1_test.py
, db2_test.py
kind-traffic-20936
01/23/2025, 7:58 PMfast-nail-55400
01/23/2025, 7:59 PMfast-nail-55400
01/23/2025, 8:00 PMSo you are saying REMOTE_INSTANCE_NAME would mean we have two completely separate caches? I think it would be good enough for us...Yes each instance name is a separate cache.
fast-nail-55400
01/23/2025, 8:01 PMlocal_environment
idea. Separate test files with common helper is probably the better option. Then the type of the database basically becomes a parameter of the test.broad-processor-92400
01/23/2025, 10:26 PMelegant-florist-94385
01/24/2025, 1:00 AM__defaults__ = {
python_test: {
extra_env_vars: parametrize(...)
}
}
(probably butchered that syntax, but you get the idea)
and it works to test with multiple different configurations of test code, and each parametrized test file gets its own cache entry, eg. /path/to/test.py#paramset1, /path/to/test.py#paramset2,
elegant-florist-94385
01/24/2025, 1:01 AMpants test
invocation.
The one (minor) drawback though, is that you can't import anything from the test files, else pants can't identify which of the variants of the file it should use for dependency inference. Its pretty minor though, just need to put all utility functions in a separate (non-test) file and call it a python_source
instead of a python_test
)kind-traffic-20936
01/24/2025, 1:39 AMkind-traffic-20936
01/24/2025, 6:32 PMbroad-processor-92400
02/02/2025, 11:31 PM