From e87fb6d153a64b563f89eab517285ad7793831b3 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Sat, 15 Nov 2025 01:14:11 +0530 Subject: [PATCH] ISSUE-44: Hithomelabs/HomeLabDocker#44 Excluding integration tests from gradle build and runs them separately in integration tests --- .gitea/workflows/integration_test.yaml | 2 +- build.gradle | 8 ++++++++ settings.gradle | 1 - .../Integration/CoudflareApiIntegrationTest.java | 1 - 4 files changed, 9 insertions(+), 3 deletions(-) delete mode 100644 settings.gradle diff --git a/.gitea/workflows/integration_test.yaml b/.gitea/workflows/integration_test.yaml index 2a46a19..3a4697c 100644 --- a/.gitea/workflows/integration_test.yaml +++ b/.gitea/workflows/integration_test.yaml @@ -23,4 +23,4 @@ jobs: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} CLOUDFLARE_EMAIL: hitanshu98@gmail.com - run: ./gradlew test --tests "com.hithomelabs.CFTunnels.Integration.CoudflareApiIntegrationTest" \ No newline at end of file + run: ./gradlew integrationTestOnly \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5fd8ad1..c85d1f3 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,14 @@ test { } } +tasks.register('integrationTestOnly', Test) { + useJUnitPlatform { + includeTags 'integration' + } + description = 'Runs only integration tests tagged with @Tag("integration")' + group = 'verification' +} + repositories { mavenCentral() } diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 3561707..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'CFTunnels' diff --git a/src/test/java/com/hithomelabs/CFTunnels/Integration/CoudflareApiIntegrationTest.java b/src/test/java/com/hithomelabs/CFTunnels/Integration/CoudflareApiIntegrationTest.java index 939e001..0ce0bc0 100644 --- a/src/test/java/com/hithomelabs/CFTunnels/Integration/CoudflareApiIntegrationTest.java +++ b/src/test/java/com/hithomelabs/CFTunnels/Integration/CoudflareApiIntegrationTest.java @@ -9,7 +9,6 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.context.annotation.Profile; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus;