-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do a mock run where everything except run is executed
- Loading branch information
pierre.delaunay
committed
Jul 8, 2024
1 parent
dd7f388
commit 3ce28f7
Showing
5 changed files
with
135 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""This file is generated, do not modify""" | ||
|
||
__tag__ = "v0.1.0-20-gf2cc75f8" | ||
__commit__ = "f2cc75f8a4728dcac223c91153119b43fec05698" | ||
__date__ = "2024-07-03 12:37:48 -0400" | ||
__tag__ = "v0.1.0-24-gdd7f3888" | ||
__commit__ = "dd7f3888ac0524b3b587e415d1de0e2019cd751f" | ||
__date__ = "2024-07-03 16:07:47 -0400" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
import milabench.commands.executors | ||
|
||
import traceback | ||
from pytest import fixture | ||
|
||
|
||
@fixture | ||
def args(standard_config, tmp_path): | ||
return [ | ||
"--base", str(tmp_path), | ||
"--config", str(standard_config) | ||
] | ||
|
||
|
||
async def mock_exec(command, phase="run", timeout=False, timeout_delay=600, **kwargs): | ||
return [0] | ||
|
||
|
||
def run_cli(*args): | ||
from milabench.cli import main | ||
|
||
print(" ".join(args)) | ||
try: | ||
main(args) | ||
except SystemExit as exc: | ||
assert not exc.code | ||
|
||
|
||
def test_milabench(monkeypatch, args): | ||
monkeypatch.setenv("MILABENCH_GPU_ARCH", "cuda") | ||
monkeypatch.setattr(milabench.commands, "execute_command", mock_exec) | ||
|
||
run_cli("install", *args) | ||
|
||
run_cli("prepare", *args) | ||
|
||
# | ||
# use Mock GPU-SMI | ||
# | ||
monkeypatch.setenv("MILABENCH_GPU_ARCH", "mock") | ||
from milabench.cli.dry import assume_gpu | ||
with assume_gpu(8): | ||
run_cli("run", *args, "--no-report") |