diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index f7102dd5342a..2bbee538635e 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -288,14 +288,21 @@ jobs: working-directory: ${{ env.special-working-directory }} if: matrix.test-suite == 'venv' - - name: Run single-workspace tests + - name: Run single-workspace tests on non-Linux env: CI_PYTHON_VERSION: ${{ matrix.python }} - uses: GabrielBB/xvfb-action@v1.6 - with: - run: npm run testSingleWorkspace - working-directory: ${{ env.special-working-directory }} - if: matrix.test-suite == 'single-workspace' + run: npm run testSingleWorkspace + shell: pwsh + working-directory: ${{ env.special-working-directory }} + if: runner.os != 'Linux' && matrix.test-suite == 'single-workspace' + + - name: Run single-workspace tests on Linux + env: + CI_PYTHON_VERSION: ${{ matrix.python }} + run: xvfb-run -a npm run testSingleWorkspace + shell: pwsh + working-directory: ${{ env.special-working-directory }} + if: runner.os == 'Linux' && matrix.test-suite == 'single-workspace' - name: Run debugger tests env: @@ -476,13 +483,21 @@ jobs: with: run: npm run testSingleWorkspace:cover - - name: Run single-workspace tests + - name: Run single-workspace tests on non-Linux env: CI_PYTHON_VERSION: ${{ env.PYTHON_VERSION }} CI_DISABLE_AUTO_SELECTION: 1 - uses: GabrielBB/xvfb-action@v1.6 - with: - run: npm run testSingleWorkspace:cover + run: npm run testSingleWorkspace:cover + shell: pwsh + if: runner.os != 'Linux' + + - name: Run single-workspace tests on Linux + env: + CI_PYTHON_VERSION: ${{ env.PYTHON_VERSION }} + CI_DISABLE_AUTO_SELECTION: 1 + run: xvfb-run -a npm run testSingleWorkspace:cover + shell: pwsh + if: runner.os == 'Linux' # Enable these tests when coverage is setup for multiroot workspace tests # - name: Run multi-workspace tests diff --git a/src/client/testing/testController/unittest/testDiscoveryAdapter.ts b/src/client/testing/testController/unittest/testDiscoveryAdapter.ts index 8e6edcc16b56..868a0ae548aa 100644 --- a/src/client/testing/testController/unittest/testDiscoveryAdapter.ts +++ b/src/client/testing/testController/unittest/testDiscoveryAdapter.ts @@ -100,6 +100,7 @@ export class UnittestTestDiscoveryAdapter implements ITestDiscoveryAdapter { throwOnStdErr: true, outputChannel: options.outChannel, env: mutableEnv, + shell: true, }; // Create the Python environment in which to execute the command. const creationOptions: ExecutionFactoryCreateWithEnvironmentOptions = { diff --git a/src/client/testing/testController/unittest/testExecutionAdapter.ts b/src/client/testing/testController/unittest/testExecutionAdapter.ts index 4746c3101752..25b97391a802 100644 --- a/src/client/testing/testController/unittest/testExecutionAdapter.ts +++ b/src/client/testing/testController/unittest/testExecutionAdapter.ts @@ -147,6 +147,7 @@ export class UnittestTestExecutionAdapter implements ITestExecutionAdapter { throwOnStdErr: true, outputChannel: options.outChannel, env: mutableEnv, + shell: true, }; // Create the Python environment in which to execute the command. const creationOptions: ExecutionFactoryCreateWithEnvironmentOptions = { diff --git a/src/test/testing/common/testingAdapter.test.ts b/src/test/testing/common/testingAdapter.test.ts index c01fed29bac7..9f182ccf3f79 100644 --- a/src/test/testing/common/testingAdapter.test.ts +++ b/src/test/testing/common/testingAdapter.test.ts @@ -163,7 +163,7 @@ suite('End to End Tests: test adapters', () => { let callCount = 0; // const deferredTillEOT = createTestingDeferred(); resultResolver._resolveDiscovery = async (payload, _token?) => { - traceLog(`resolveDiscovery ${payload}`); + traceLog(`resolveDiscovery ${JSON.stringify(payload)}`); callCount = callCount + 1; actualData = payload; return Promise.resolve(); @@ -188,7 +188,9 @@ suite('End to End Tests: test adapters', () => { assert.strictEqual( actualData.status, 'success', - `Expected status to be 'success' instead status is ${actualData.status}`, + `Expected status to be 'success' instead status is ${actualData.status}, error: ${ + actualData.error + }, payload: ${JSON.stringify(actualData)}`, ); // 2. Confirm no errors assert.strictEqual(actualData.error, undefined, "Expected no errors in 'error' field"); @@ -210,7 +212,7 @@ suite('End to End Tests: test adapters', () => { resultResolver = new PythonResultResolver(testController, unittestProvider, workspaceUri); let callCount = 0; resultResolver._resolveDiscovery = async (payload, _token?) => { - traceLog(`resolveDiscovery ${payload}`); + traceLog(`resolveDiscovery ${JSON.stringify(payload)}`); callCount = callCount + 1; actualData = payload; return Promise.resolve(); @@ -232,7 +234,9 @@ suite('End to End Tests: test adapters', () => { assert.strictEqual( actualData.status, 'success', - `Expected status to be 'success' instead status is ${actualData.status}`, + `Expected status to be 'success' instead status is ${actualData.status}, error: ${ + actualData.error + }, payload: ${JSON.stringify(actualData)}`, ); // 2. Confirm no errors assert.strictEqual(actualData.error, undefined, "Expected no errors in 'error' field"); @@ -274,7 +278,9 @@ suite('End to End Tests: test adapters', () => { assert.strictEqual( actualData.status, 'success', - `Expected status to be 'success' instead status is ${actualData.status}`, + `Expected status to be 'success' instead status is ${actualData.status}, error: ${ + actualData.error + }, payload: ${JSON.stringify(actualData)}`, ); // 2. Confirm no errors assert.strictEqual(actualData.error?.length, 0, "Expected no errors in 'error' field"); // 3. Confirm tests are found @@ -309,7 +315,7 @@ suite('End to End Tests: test adapters', () => { resultResolver = new PythonResultResolver(testController, pytestProvider, workspaceUri); let callCount = 0; resultResolver._resolveDiscovery = async (payload, _token?) => { - traceLog(`resolveDiscovery ${payload}`); + traceLog(`resolveDiscovery ${JSON.stringify(payload)}`); callCount = callCount + 1; actualData = payload; return Promise.resolve(); @@ -330,7 +336,9 @@ suite('End to End Tests: test adapters', () => { assert.strictEqual( actualData.status, 'success', - `Expected status to be 'success' instead status is ${actualData.status}`, + `Expected status to be 'success' instead status is ${actualData.status}, error: ${ + actualData.error + }, payload: ${JSON.stringify(actualData)}`, ); // 2. Confirm no errors assert.strictEqual(actualData.error?.length, 0, "Expected no errors in 'error' field"); // 3. Confirm tests are found @@ -398,7 +406,7 @@ suite('End to End Tests: test adapters', () => { resultResolver = new PythonResultResolver(testController, pytestProvider, workspaceUri); let callCount = 0; resultResolver._resolveDiscovery = async (payload, _token?) => { - traceLog(`resolveDiscovery ${payload}`); + traceLog(`resolveDiscovery ${JSON.stringify(payload)}`); callCount = callCount + 1; actualData = payload; return Promise.resolve(); @@ -419,7 +427,9 @@ suite('End to End Tests: test adapters', () => { assert.strictEqual( actualData.status, 'success', - `Expected status to be 'success' instead status is ${actualData.status}`, + `Expected status to be 'success' instead status is ${actualData.status}, error: ${ + actualData.error + }, payload: ${JSON.stringify(actualData)}`, ); // 2. Confirm no errors assert.strictEqual(actualData.error?.length, 0, "Expected no errors in 'error' field"); // 3. Confirm tests are found @@ -474,7 +484,7 @@ suite('End to End Tests: test adapters', () => { resultResolver = new PythonResultResolver(testController, pytestProvider, workspaceUri); let callCount = 0; resultResolver._resolveDiscovery = async (payload, _token?) => { - traceLog(`resolveDiscovery ${payload}`); + traceLog(`resolveDiscovery ${JSON.stringify(payload)}`); callCount = callCount + 1; actualData = payload; return Promise.resolve(); @@ -497,7 +507,9 @@ suite('End to End Tests: test adapters', () => { assert.strictEqual( actualData.status, 'success', - `Expected status to be 'success' instead status is ${actualData.status}`, + `Expected status to be 'success' instead status is ${actualData.status}, error: ${ + actualData.error + }, payload: ${JSON.stringify(actualData)}`, ); // 2. Confirm no errors assert.strictEqual(actualData.error?.length, 0, "Expected no errors in 'error' field"); // 3. Confirm tests are found @@ -513,14 +525,16 @@ suite('End to End Tests: test adapters', () => { let failureOccurred = false; let failureMsg = ''; resultResolver._resolveExecution = async (payload, _token?) => { - traceLog(`resolveDiscovery ${payload}`); + traceLog(`resolveDiscovery ${JSON.stringify(payload)}`); callCount = callCount + 1; // the payloads that get to the _resolveExecution are all data and should be successful. try { assert.strictEqual( payload.status, 'success', - `Expected status to be 'success', instead status is ${payload.status}`, + `Expected status to be 'success' instead status is ${payload.status}, error: ${ + payload.error + }, payload: ${JSON.stringify(payload)}`, ); assert.ok(payload.result, 'Expected results to be present'); } catch (err) { @@ -592,14 +606,16 @@ suite('End to End Tests: test adapters', () => { let failureOccurred = false; let failureMsg = ''; resultResolver._resolveExecution = async (payload, _token?) => { - traceLog(`resolveDiscovery ${payload}`); + traceLog(`resolveDiscovery ${JSON.stringify(payload)}`); callCount = callCount + 1; // the payloads that get to the _resolveExecution are all data and should be successful. try { const validStatuses = ['subtest-success', 'subtest-failure']; assert.ok( validStatuses.includes(payload.status), - `Expected status to be one of ${validStatuses.join(', ')}, but instead status is ${payload.status}`, + `Expected status to be one of ${validStatuses.join(', ')}, but instead status is ${ + payload.status + }, error: ${payload.error}`, ); assert.ok(payload.result, 'Expected results to be present'); } catch (err) { @@ -668,14 +684,16 @@ suite('End to End Tests: test adapters', () => { let failureOccurred = false; let failureMsg = ''; resultResolver._resolveExecution = async (payload, _token?) => { - traceLog(`resolveDiscovery ${payload}`); + traceLog(`resolveDiscovery ${JSON.stringify(payload)}`); callCount = callCount + 1; // the payloads that get to the _resolveExecution are all data and should be successful. try { assert.strictEqual( payload.status, 'success', - `Expected status to be 'success', instead status is ${payload.status}`, + `Expected status to be 'success' instead status is ${payload.status}, error: ${ + payload.error + }, payload: ${JSON.stringify(payload)}`, ); assert.ok(payload.result, 'Expected results to be present'); } catch (err) { @@ -757,14 +775,16 @@ suite('End to End Tests: test adapters', () => { let failureOccurred = false; let failureMsg = ''; resultResolver._resolveExecution = async (payload, _token?) => { - traceLog(`resolveDiscovery ${payload}`); + traceLog(`resolveDiscovery ${JSON.stringify(payload)}`); callCount = callCount + 1; // the payloads that get to the _resolveExecution are all data and should be successful. try { assert.strictEqual( payload.status, 'success', - `Expected status to be 'success', instead status is ${payload.status}`, + `Expected status to be 'success' instead status is ${payload.status}, error: ${ + payload.error + }, payload: ${JSON.stringify(payload)}`, ); assert.ok(payload.result, 'Expected results to be present'); } catch (err) {