|
39 | 39 | # xppath: examples/benchmarks/rpl-req-resp
|
40 | 40 | # flags:
|
41 | 41 | # CONFIG: CONFIG_CSMA
|
| 42 | +# - setup: other |
| 43 | +# duration: 120 |
| 44 | +# label: A custom run, by commit hash |
| 45 | +# repository: contiki-ng/contiki-ng |
| 46 | +# commit: 4928a5e1e035d42313b0e3ed73e14565d972510b |
| 47 | +# xppath: examples/benchmarks/rpl-req-resp |
| 48 | +# flags: |
| 49 | +# CONFIG: CONFIG_CSMA |
| 50 | +# |
42 | 51 |
|
43 | 52 | def lock_is_taken():
|
44 | 53 | return os.path.exists(LOCK_PATH)
|
@@ -67,16 +76,21 @@ def run(task):
|
67 | 76 | setupData.update(task)
|
68 | 77 | setup = task["setup"]
|
69 | 78 | repository = setupData["repository"]
|
70 |
| - branch = setupData["branch"] |
| 79 | + branch = setupData["branch"] if "branch" in setupData else None |
| 80 | + commit = setupData["commit"] if "commit" in setupData else None |
71 | 81 | log("Preparing")
|
72 | 82 | # Go to Contiki-NG
|
73 | 83 | os.chdir(PATH_CONTIKI_NG)
|
74 | 84 | # Add remote
|
75 | 85 | os.system("git remote add %s git@github.com:%s.git\n"%(repository, repository))
|
76 | 86 | # Fetch and check out branch
|
77 |
| - os.system("git fetch %s %s\n"%(repository, branch)) |
78 |
| - os.system("git checkout %s/%s\n"%(repository, branch)) |
79 |
| - os.system("git reset --hard %s/%s\n"%(repository, branch)) |
| 87 | + os.system("git fetch %s\n"%(repository)) |
| 88 | + if commit is None: |
| 89 | + os.system("git checkout %s/%s\n"%(repository, branch)) |
| 90 | + os.system("git reset --hard %s/%s\n"%(repository, branch)) |
| 91 | + else: |
| 92 | + os.system("git checkout %s\n"%(commit)) |
| 93 | + os.system("git reset --hard %s\n"%(commit)) |
80 | 94 | os.system("git clean -fd\n")
|
81 | 95 | # Get git commit hash
|
82 | 96 | task["commit"] = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip().decode("utf-8")
|
|
0 commit comments