Hey all, we've got 2 projects in our monorepo that...
# general
r
Hey all, we've got 2 projects in our monorepo that each have a config file with the same name. In our unit tests we relocate that config file to the sandbox directory using the
relocated_files
goal. However, the coverage plugin is failing now due to the following intrinsic error:
Copy code
IntrinsicError: Can only merge Directories with no duplicates, but found 2 duplicate entries in :
This seems to be the problematic source code in question. Is this a legitimate bug or is there a way around this issue?
b
Could you share the relevant parts of your BUILD files?
r
Copy code
relocated_files(
    name="meltano_config",
    files_targets=[f"{build_file_dir().parent}:meltano_config"],
    src=str(build_file_dir().parent),
    dest="",
)  # this target copies meltano.yml to sandbox directory before the tests run

python_tests(
    dependencies=[":meltano_config"],
    # the extra env vars below are required because these tests will call the meltano CLI directly
    # this tells the PEX to export itself to a temporary venv and add that venv to the PATH variable
    # PEX environment variables reference: <https://pex.readthedocs.io/en/v2.1.135/api/vars.html>
    extra_env_vars=["PEX_VENV=1", "PEX_VENV_BIN_PATH=prepend"],
)
These same
BUILD
contents appear in a
tests
subdirectory in 2 projects in our repo.
b
Ah, and the
meltano
config needs to be in the root of the sandbox?
r
yep exactly
works perfectly except when it goes to collect test coverage
because multiple projects have a
meltano.yml
b
Frustrating! That does sound like a bug (pants shouldn't be getting in your way...), so please file one. Some work-arounds I can think of: ā€¢ disable coverage ā€¢ some way to leave the
meltano.yml
configs where they are, rather ending up with multiple in the root of the repo
r
Cool, I just wanted to confirm that was the case before filing my bug. Will do so first thing tomorrow. šŸ˜