ray/release/golden_notebook_tests/workloads/modin_xgboost_test.py
Kai Fricke 430ea3e636
[ci/release] Migrate golden notebook tests (#22949)
Migrating golden notebook tests to new release test package.
Tests are passing: https://buildkite.com/ray-project/release-tests-branch/builds/155
2022-03-13 21:39:41 +00:00

38 lines
905 B
Python

import ray
import os
import time
import json
from util import import_and_execute_test_script
NOTEBOOK_PATH_RELATIVE_TO_RAY_REPO = (
"doc/source/ray-core/examples/modin_xgboost/modin_xgboost.py"
)
def main():
import_and_execute_test_script(NOTEBOOK_PATH_RELATIVE_TO_RAY_REPO)
if __name__ == "__main__":
start = time.time()
addr = os.environ.get("RAY_ADDRESS")
job_name = os.environ.get("RAY_JOB_NAME", "modin_xgboost_test")
if addr is not None and addr.startswith("anyscale://"):
ray.init(address=addr, job_name=job_name)
else:
ray.init(address="auto")
main()
taken = time.time() - start
result = {
"time_taken": taken,
}
test_output_json = os.environ.get(
"TEST_OUTPUT_JSON", "/tmp/modin_xgboost_test.json"
)
with open(test_output_json, "wt") as f:
json.dump(result, f)
print("Test Successful!")