Skip to content

Commit

Permalink
changes after force push (#11094)
Browse files Browse the repository at this point in the history
Co-authored-by: Rishabh Kumar <rishabhkkumarsc1@gmail.com>
  • Loading branch information
RickSanchezStoic and Rishabh Kumar authored Feb 27, 2023
1 parent fcf5dc2 commit 3adade8
Show file tree
Hide file tree
Showing 8 changed files with 934 additions and 153 deletions.
37 changes: 36 additions & 1 deletion ivy_tests/test_ivy/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"torch": None,
} # multiversion

ground_backend=None # multiversion

# local
import ivy_tests.test_ivy.helpers.test_parameter_flags as pf
Expand Down Expand Up @@ -66,6 +67,8 @@ def pytest_configure(config):
frontend_strs = frontend.split(",")
for i in frontend_strs:
process = subprocess.Popen(


[
"/opt/miniconda/envs/multienv/bin/python",
"multiversion_frontend_test.py",
Expand All @@ -79,6 +82,24 @@ def pytest_configure(config):
)
mod_frontend[i.split("/")[0]] = [i, process]

#ground truth
ground_truth=config.getoption("--ground_truth")
global ground_backend
if ground_truth:
ground_backend = [ground_truth,subprocess.Popen([
"/opt/miniconda/envs/multienv/bin/python",
"multiversion_backend_test.py",
"numpy" + "/" + importlib.import_module("numpy").__version__,
ground_truth,
],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,)]




# compile_graph
raw_value = config.getoption("--compile_graph")
if raw_value == "both":
Expand Down Expand Up @@ -130,14 +151,27 @@ def run_around_tests(request, on_device, backend_fw, compile_graph, implicit):
ivy_test = hasattr(request.function, "_ivy_test")
if ivy_test:
try:
test_globals.setup_api_test(

if ground_backend:
test_globals.setup_api_test(
backend_fw.backend,
ground_backend,
on_device,
request.function.test_data
if hasattr(request.function, "test_data")
else None,
)
else:

test_globals.setup_api_test(
backend_fw.backend,
request.function.ground_truth_backend,
on_device,
request.function.test_data
if hasattr(request.function, "test_data")
else None,
)

except Exception as e:
test_globals.teardown_api_test()
raise RuntimeError(f"Setting up test for {request.function} failed.") from e
Expand Down Expand Up @@ -212,6 +246,7 @@ def pytest_addoption(parser):
parser.addoption("--compile_graph", action="store_true")
parser.addoption("--with_implicit", action="store_true")
parser.addoption("--frontend", action="store", default=None)
parser.addoption("--ground_truth",action="store",default=None)
parser.addoption("--skip-variable-testing", action="store_true")
parser.addoption("--skip-native-array-testing", action="store_true")
parser.addoption("--skip-out-testing", action="store_true")
Expand Down
Loading

0 comments on commit 3adade8

Please sign in to comment.