Skip to content

Commit

Permalink
BF(TST): trace whoami instead of ls in test_trace_local
Browse files Browse the repository at this point in the history
quick summary of the problem: on debian there is bin -> usr/bin symlink,
but then /bin/ls is the one known to the package. reprozip resolves path
to /usr/bin/ls and we end up without package information.

More info on VIDA-NYU/reprozip#390
and reproman specific issue ReproNim#591
  • Loading branch information
yarikoptic committed Jan 18, 2023
1 parent 13e0339 commit a5c96b6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions reproman/interface/tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ def test_trace_docker(docker_container, trace_info):
@pytest.mark.integration
@mark.skipif_no_network
@mark.skipif_no_apt_cache
# Error: trace.sqlite3 doesnt exist in the directory https://github.com/VIDA-NYU/reprozip/issues/387
@pytest.mark.xfail(reason="Our extracted standalone reprozip tracer is currently broken.")
def test_trace_local(trace_info):
with patch("reproman.resource.ResourceManager._get_inventory") as get_inv:
config = {"status": "running",
Expand All @@ -136,7 +134,7 @@ def test_trace_local(trace_info):
return_value=ResourceManager()):
with patch("reproman.interface.execute.CMD_CLASSES",
{"trace": trace_info["class"]}):
execute("ls", ["-l"], trace=True, resref="testing-local")
execute("whoami", ["--version"], trace=True, resref="testing-local")

local_dir = trace_info["local"]
assert set(os.listdir(local_dir)) == {"traces", "tracers"}
Expand All @@ -149,7 +147,7 @@ def test_trace_local(trace_info):
if dist.name == "debian"]
assert len(deb_dists) == 1

expect = {"packages": [{"files": ["/bin/ls"], "name": "coreutils"}]}
expect = {"packages": [{"files": ["/usr/bin/whoami"], "name": "coreutils"}]}
assert_is_subset_recur(expect, attr.asdict(deb_dists[0]), [dict, list])


Expand Down

0 comments on commit a5c96b6

Please sign in to comment.