Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run copy results after tests failures #23964

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe("DynamicComposedChart component test", () => {
test("renders without crashing with data", () => {
render(<DynamicComposedChart dataSets={testDataSets} />);
const dynamicComposedChartElement = screen.findByTestId("test-dynamic-composed-chart");
expect(dynamicComposedChartElement).not.toBeNull();
expect(dynamicComposedChartElement).toBeNull();
expect(dynamicComposedChartElement).toBeDefined();
});

Expand Down
7 changes: 4 additions & 3 deletions tools/pipelines/templates/build-npm-client-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ extends:
# Set variable startTest if everything is good so far and we'll start running tests,
# so that the steps to process/upload test coverage results only run if we got to the point of actually running tests.
- script: |
echo "##vso[task.setvariable variable=startTest]true"
echo "##vso[task.setvariable variable=startTestCoverage]true"
displayName: Start Test

- ${{ each test in parameters.coverageTests }}:
Expand All @@ -608,7 +608,7 @@ extends:

- task: Npm@1
displayName: 'npm run test:copyresults'
condition: and(succeededOrFailed(), eq(variables['startTest'], 'true'))
condition: and(succeededOrFailed(), eq(variables['startTestCoverage'], 'true'))
inputs:
command: custom
workingDir: '${{ parameters.buildDirectory }}'
Expand All @@ -620,7 +620,7 @@ extends:
# A quick fix to patch the file with sed. (See https://github.com/bcoe/c8/issues/302)
- task: Bash@3
displayName: Check for nyc/report directory
condition: and(succeededOrFailed(), eq(variables['startTest'], 'true'))
condition: and(succeededOrFailed(), eq(variables['startTestCoverage'], 'true'))
inputs:
targetType: 'inline'
workingDirectory: '${{ parameters.buildDirectory }}'
Expand Down Expand Up @@ -761,6 +761,7 @@ extends:

- task: Npm@1
displayName: 'npm run test:copyresults'
condition: and(succeededOrFailed(), eq(variables['startTest'], 'true'))
inputs:
command: custom
workingDir: '${{ parameters.buildDirectory }}'
Expand Down
1 change: 1 addition & 0 deletions tools/pipelines/templates/build-npm-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ extends:
# Set variable startTest if the build succeed so that we can run all the test tasks whether they are failed or not
- script: |
echo "##vso[task.setvariable variable=startTest]true"
echo "##vso[task.setvariable variable=startTestCoverage]true"
displayName: Start Test

- ${{ each taskTestStep in parameters.taskTest }}:
Expand Down
1 change: 1 addition & 0 deletions tools/pipelines/templates/include-test-stability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
# Set variable startTest if the build succeed so that we can run all the test tasks whether they are failed or not
- script: |
echo "##vso[task.setvariable variable=startTest]true"
echo "##vso[task.setvariable variable=startTestCoverage]true"
displayName: Start Test

- ${{ each taskTestStep in parameters.taskTest }}:
Expand Down
2 changes: 1 addition & 1 deletion tools/pipelines/templates/include-test-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ steps:
command: 'custom'
workingDir: ${{ parameters.buildDirectory }}
customCommand: 'run ${{ parameters.taskTestStep }}:coverage'
condition: and(succeededOrFailed(), eq(variables['startTest'], 'true'))
condition: and(succeededOrFailed(), eq(variables['startTestCoverage'], 'true'))
env:
# Tests can use this environment variable to behave differently when running from a test branch
${{ if contains(parameters.taskTestStep, 'tinylicious') }}:
Expand Down
Loading