Unverified Commit f8d6bf8e authored by Jinjing Zhou's avatar Jinjing Zhou Committed by GitHub
Browse files

[Test] Fix regression ram info (#2964)

* fix regression ram info

* fix
parent 0e964ea5
......@@ -119,6 +119,8 @@ pipeline {
script {
def comment = env.GITHUB_COMMENT
def author = env.GITHUB_COMMENT_AUTHOR
echo("${env.GIT_URL}")
echo("${env}")
if (!is_authorized(author)) {
error('Not authorized to launch regression tests')
}
......@@ -135,9 +137,10 @@ pipeline {
} else {
pullRequest.comment("Start the Regression test. View at ${RUN_DISPLAY_URL}")
}
def prNumber = env.BRANCH_NAME.replace('PR-', '')
dir('benchmarks/scripts') {
sh('python3 -m pip install boto3')
sh("PYTHONUNBUFFERED=1 GIT_URL=${env.GIT_URL} GIT_BRANCH=${env.CHANGE_BRANCH} python3 run_reg_test.py --data-folder ${env.GIT_COMMIT}_${instance_type} --run-cmd '${comment}'")
sh("PYTHONUNBUFFERED=1 GIT_PR_ID=${prNumber} GIT_URL=${env.GIT_URL} GIT_BRANCH=${env.CHANGE_BRANCH} python3 run_reg_test.py --data-folder ${env.GIT_COMMIT}_${instance_type} --run-cmd '${comment}'")
}
pullRequest.comment("Finished the Regression test. Result table is at https://dgl-asv-data.s3-us-west-2.amazonaws.com/${env.GIT_COMMIT}_${instance_type}/results/result.csv. Jenkins job link is ${RUN_DISPLAY_URL}. ")
currentBuild.result = 'SUCCESS'
......
from pathlib import Path
import json
def main():
result_dir = Path(__file__).parent/ ".." / Path("results/")
for per_machine_dir in result_dir.iterdir():
if per_machine_dir.is_dir():
try:
machine_json = json.loads((per_machine_dir/"machine.json").read_text())
ram = machine_json["ram"]
for f in per_machine_dir.glob("*.json"):
if f.stem != "machine":
result = json.loads(f.read_text())
result_ram = result["params"]["ram"]
if result_ram != ram:
result["params"]["ram"] = ram
print(f"Fix ram in {f}")
f.write_text(json.dumps(result))
else:
print(f"Skip {f}")
except Exception as e:
print(e)
main()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment