From a1f758654a98a702e9277b12cb2ae9a6a78f7a12 Mon Sep 17 00:00:00 2001 From: JannisHaeffner Date: Wed, 11 Feb 2026 17:49:22 +0100 Subject: [PATCH] fix: update new repo structure in the integration test Update the repo created in the integration test to match the new setup where each request gets its own repo. Closes #142 --- .../controller/CiWebhookIntegrationTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/java/ci/controller/CiWebhookIntegrationTest.java b/src/test/java/ci/controller/CiWebhookIntegrationTest.java index f29df24..7aeb62d 100644 --- a/src/test/java/ci/controller/CiWebhookIntegrationTest.java +++ b/src/test/java/ci/controller/CiWebhookIntegrationTest.java @@ -144,12 +144,13 @@ void successfulBuild_postsPendingThenSuccess() throws Exception { * iff all checks within the runBuild function pass, updates the status 200 "success". */ - // Create the repo so it passes checks - Files.createDirectories(temp.resolve(REPO_ID)); - - // sets value repoParentDir in ciService to temp + // Set value repoParentDir in ciService to temp ReflectionTestUtils.setField(ciService, "repoParentDir", temp.toString()); + // Create the repo so it passes checks + String sha = "0123456789abcdef0123456789abcdef01234567"; + Files.createDirectories(temp.resolve("test").resolve(sha).resolve(REPO_ID)); + // Fake compilation success - when the compile function is caled always return success as true CompilationService compilationMock = mock(CompilationService.class); when(compilationMock.compile(any())) @@ -179,7 +180,6 @@ void successfulBuild_postsPendingThenSuccess() throws Exception { })) { // Building the fake payload - String sha = "0123456789abcdef0123456789abcdef01234567"; byte[] payloadBody = buildPayload(sha); String sig = "sha256=" + computeHMACWithSHA256(SECRET, payloadBody); @@ -209,12 +209,13 @@ void failedBuild_postsPendingThenFailure() throws Exception { * iff all the build fails, updates the status to "failure". */ - // Create the repo so it passes checks - Files.createDirectories(temp.resolve(REPO_ID)); - - // sets value repoParentDir in ciService to temp + // Set value repoParentDir in ciService to temp ReflectionTestUtils.setField(ciService, "repoParentDir", temp.toString()); + // Create the repo so it passes checks + String sha = "0123456789abcdef0123456789abcdef01234567"; + Files.createDirectories(temp.resolve("test").resolve(sha).resolve(REPO_ID)); + // Fake compilation success - when the compile function is caled always return success as true CompilationService compilationMock = mock(CompilationService.class); when(compilationMock.compile(any())) @@ -244,7 +245,6 @@ void failedBuild_postsPendingThenFailure() throws Exception { })) { // Building the fake payload - String sha = "0123456789abcdef0123456789abcdef01234567"; byte[] payloadBody = buildPayload(sha); String sig = "sha256=" + computeHMACWithSHA256(SECRET, payloadBody);