MCPcopy Create free account
hub / github.com/apache/tvm / fn

Function fn

tests/scripts/ci.py:379–442  ·  view source on GitHub ↗

arguments: tests -- pytest test IDs (e.g. tests/python or tests/python/a_file.py::a_test[param=1]) skip_build -- skip build and setup scripts interactive -- start a shell after running build / test scripts docker-image -- manually specify the docker image to

(
        tests: list[str] | None = None,
        skip_build: bool = False,
        interactive: bool = False,
        docker_image: str | None = None,
        verbose: bool = False,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

377 """
378
379 def fn(
380 tests: list[str] | None = None,
381 skip_build: bool = False,
382 interactive: bool = False,
383 docker_image: str | None = None,
384 verbose: bool = False,
385 **kwargs,
386 ) -> None:
387 """
388 arguments:
389 tests -- pytest test IDs (e.g. tests/python or tests/python/a_file.py::a_test[param=1])
390 skip_build -- skip build and setup scripts
391 interactive -- start a shell after running build / test scripts
392 docker-image -- manually specify the docker image to use
393 verbose -- run verbose build
394 """
395 if precheck is not None:
396 precheck()
397
398 build_dir = get_build_dir(name)
399
400 if skip_build:
401 scripts = []
402 else:
403 scripts = [
404 f"./tests/scripts/task_config_build_{name}.sh {build_dir}",
405 f"./tests/scripts/task_build.py --build-dir {build_dir}",
406 ]
407
408 if post_build is not None:
409 scripts += post_build
410
411 # Check that a test suite was not used alongside specific test names
412 if any(v for v in kwargs.values()) and tests is not None:
413 option_flags = ", ".join([f"--{k}" for k in options.keys()])
414 clean_exit(f"{option_flags} cannot be used with --tests")
415
416 if tests is not None:
417 scripts.append(f"python3 -m pytest {' '.join(tests)}")
418
419 # Add named test suites
420 for option_name, (_, extra_scripts) in options.items():
421 if kwargs.get(option_name, False):
422 scripts.extend(script.format(build_dir=build_dir) for script in extra_scripts)
423
424 docker_env = {
425 # Need to specify the library path manually or else TVM can't
426 # determine which build directory to use (i.e. if there are
427 # multiple copies of libtvm_compiler.so / libtvm_runtime.so laying around)
428 "TVM_LIBRARY_PATH": str(REPO_ROOT / get_build_dir(name)),
429 "VERBOSE": "true" if verbose else "false",
430 }
431
432 if env is not None:
433 docker_env.update(env)
434
435 docker(
436 name=gen_name(f"ci-{name}"),

Callers 2

_register_nb_formFunction · 0.50
mainFunction · 0.50

Calls 14

get_build_dirFunction · 0.85
clean_exitFunction · 0.85
strFunction · 0.85
dockerFunction · 0.85
gen_nameFunction · 0.85
extendMethod · 0.80
anyFunction · 0.50
valuesMethod · 0.45
joinMethod · 0.45
keysMethod · 0.45
appendMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected