|
50 | 50 | // the test name there, e.g. "bundle/variables/empty". |
51 | 51 | // Then install your breakpoints and click "debug test" near TestInprocessMode in VSCODE. |
52 | 52 | // |
53 | | -// To debug integration tests you can run the "deco env flip workspace" command to configure a workspace |
54 | | -// and then click on "debug test" near TestInprocessMode. |
55 | | - |
56 | 53 | // If enabled, instead of compiling and running CLI externally, we'll start in-process server that accepts and runs |
57 | 54 | // CLI commands. The $CLI in test scripts is a helper that just forwards command-line arguments to this server (see bin/callserver.py). |
58 | 55 | // Also disables parallelism in tests. |
@@ -108,16 +105,19 @@ func TestInprocessMode(t *testing.T) { |
108 | 105 | if InprocessMode && !Forcerun { |
109 | 106 | t.Skip("Already tested by TestAccept") |
110 | 107 | } |
| 108 | + if os.Getenv("CLOUD_ENV") != "" { |
| 109 | + t.Skip("No need to run this as integration test.") |
| 110 | + } |
| 111 | + |
| 112 | + // Uncomment to load ~/.databricks/debug-env.json to debug integration tests |
| 113 | + // testutil.LoadDebugEnvIfRunFromIDE(t, "workspace") |
| 114 | + // Run the "deco env flip workspace" command to configure a workspace. |
| 115 | + |
111 | 116 | require.Equal(t, 1, testAccept(t, true, "selftest/basic")) |
112 | 117 | require.Equal(t, 1, testAccept(t, true, "selftest/server")) |
113 | 118 | } |
114 | 119 |
|
115 | 120 | func testAccept(t *testing.T, inprocessMode bool, singleTest string) int { |
116 | | - // Load debug environment when debugging a single test run from an IDE. |
117 | | - if singleTest != "" && inprocessMode { |
118 | | - testutil.LoadDebugEnvIfRunFromIDE(t, "workspace") |
119 | | - } |
120 | | - |
121 | 121 | repls := testdiff.ReplacementsContext{} |
122 | 122 | cwd, err := os.Getwd() |
123 | 123 | require.NoError(t, err) |
@@ -281,7 +281,7 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int { |
281 | 281 |
|
282 | 282 | t.Logf("Summary (dirs): %d/%d/%d run/selected/total, %d skipped", selectedDirs-skippedDirs, selectedDirs, totalDirs, skippedDirs) |
283 | 283 |
|
284 | | - return len(testDirs) |
| 284 | + return selectedDirs - skippedDirs |
285 | 285 | } |
286 | 286 |
|
287 | 287 | func getEnvFilters(t *testing.T) []string { |
|
0 commit comments