diff --git a/package.json b/package.json index f4665e91..24b6789a 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "connect": "npx tsx tests/connectbenchmarks.ts", "format": "prettier . --write --config .prettierrc", "integration": "jest --config=jest.integration.config.json", + "debug-integration": "node --inspect-brk=0.0.0.0:5005 ./node_modules/jest/bin/jest.js --config=jest.integration.config.json --runInBand", "lint": "eslint --fix --ext .ts .", "prepare": "husky install", "test": "jest --config=jest.unit.config.json" diff --git a/tests/integration/host/build.gradle.kts b/tests/integration/host/build.gradle.kts index 0b3dbb83..6cda1490 100644 --- a/tests/integration/host/build.gradle.kts +++ b/tests/integration/host/build.gradle.kts @@ -135,3 +135,25 @@ tasks.register("debug-aurora") { systemProperty("exclude-performance", "true") } } + +tasks.register("debug-aurora-pg") { + group = "verification" + filter.includeTestsMatching("integration.host.TestRunner.debugTests") + doFirst { + systemProperty("exclude-docker", "true") + systemProperty("exclude-performance", "true") + systemProperty("exclude-mysql-driver", "true") + systemProperty("exclude-mysql-engine", "true") + } +} + +tasks.register("debug-aurora-mysql") { + group = "verification" + filter.includeTestsMatching("integration.host.TestRunner.debugTests") + doFirst { + systemProperty("exclude-docker", "true") + systemProperty("exclude-performance", "true") + systemProperty("exclude-pg-driver", "true") + systemProperty("exclude-pg-engine", "true") + } +} diff --git a/tests/integration/host/src/test/java/integration/host/util/ContainerHelper.java b/tests/integration/host/src/test/java/integration/host/util/ContainerHelper.java index c2028612..f88d1641 100644 --- a/tests/integration/host/src/test/java/integration/host/util/ContainerHelper.java +++ b/tests/integration/host/src/test/java/integration/host/util/ContainerHelper.java @@ -86,7 +86,6 @@ public void runTest(GenericContainer container, String testFolder, TestEnviro execInContainer(container, consumer, "printenv", "TEST_ENV_DESCRIPTION"); execInContainer(container, consumer, "npm", "install", "--no-save"); - final String filter = System.getenv("FILTER"); Long exitCode; @@ -107,21 +106,17 @@ public void debugTest(GenericContainer container, String testFolder, TestEnvi execInContainer(container, consumer, "printenv", "TEST_ENV_DESCRIPTION"); execInContainer(container, consumer, "npm", "install", "--no-save"); - // Long exitCode; - // String reportSetting = String.format( - // "--html=./tests/integration/container/reports/%s.html", - // config.getPrimaryInfo()); - // System.out.println("\n\n Starting debugpy - you may now attach to the - // debugger from vscode...\n\n"); - // exitCode = execInContainer(container, consumer, - // "poetry", "run", "python", "-Xfrozen_modules=off", "-m", "debugpy", - // "--listen", "0.0.0.0:5005", - // "--wait-for-client", - // "./tests/integration/container/scripts/debug_integration_vscode.py", - // System.getenv("FILTER"), reportSetting, testFolder); - - // System.out.println("==== Container console feed ==== <<<<"); - // assertEquals(0, exitCode, "Some tests failed."); + final String filter = System.getenv("FILTER"); + + Long exitCode; + if (filter != null) { + exitCode = execInContainer(container, consumer, "npm", "run", "debug-integration", "--", "-t", filter); + } else { + exitCode = execInContainer(container, consumer, "npm", "run", "debug-integration"); + } + + System.out.println("==== Container console feed ==== <<<<"); + assertEquals(0, exitCode, "Some tests failed."); } public GenericContainer createTestContainer(String dockerImageName, String testContainerImageName) {