Skip to content

Commit d0d49c2

Browse files
committed
Fix tests
1 parent ad0a39b commit d0d49c2

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

test/CheckCheribuildProjects.groovy

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ class CheckCheribuildProjects extends BaseRegressionTest {
3636
@Test
3737
void qemu_pr_test_run() throws Exception {
3838
CommonTestHelper.addEnvVars(this, ["JOB_NAME": "QEMU/qemu-cheri", "CHANGE_ID": "12"])
39-
binding.setVariable('pullRequest', [
40-
labels : [],
41-
commits: [[sha: "12345abc", statuses: []]]
42-
])
4339
// Normal run should work
4440
runScript("test-scripts/qemu.groovy")
4541
printCallStack()

test/CommonTestHelper.groovy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ class CommonTestHelper {
2525
}
2626
}
2727

28+
static class PullRequestMock {
29+
List<String> labels = []
30+
List<Map<String, Object>> commits = [[sha: "12345abc", statuses: []]]
31+
boolean draft = false
32+
String head = "12345abc"
33+
public void createStatus(Map args) {
34+
println("createStatus: ${args}")
35+
}
36+
}
37+
2838
// static def withEnvInterceptor = { list, closure ->
2939
// oldEnv = binding.getVariable("env")
3040
// newEnv = oldEnv.clone()
@@ -126,6 +136,7 @@ class CommonTestHelper {
126136
def scmBranch = "feature_test"
127137
binding.setVariable('scm', [branch: 'master', url: 'https://www.github.com/CTSRD-CHERI/' + testName + '.git'])
128138
binding.setVariable('docker', new DockerMock())
139+
binding.setVariable('pullRequest', new PullRequestMock())
129140
test.addEnvVar('NODE_LABELS', 'linux14 linux docker')
130141
test.addEnvVar('UNIT_TEST', 'true')
131142
test.addEnvVar('CHANGE_ID', null)

0 commit comments

Comments
 (0)