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

Test status checks #252

Closed
wants to merge 4 commits into from
Closed
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
160 changes: 4 additions & 156 deletions .github/workflows/beyond-doubt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: images
run: >-
ansible-playbook images.yaml
ansible-playbook binaries.yaml
-e binary_storage=${{ env.BINARY_STORAGE }}
-e image_storage=${{ env.IMAGE_STORAGE }}
-e devenv=${{ matrix.env.dev }}
Expand All @@ -71,163 +71,11 @@ jobs:
require_tests: "${{ steps.images.outcome == 'failure' }}"
fail_on_failure: false
job_summary: false

stack-building:
name: Stack building (${{ matrix.env.dev }}, ${{ matrix.env.ops }})
timeout-minutes: 5
needs: [up-to-images]
strategy:
fail-fast: false
matrix:
purpose: [func]
env:
- dev: godel
os: ubuntu-20.04
ops: marx
- dev: turing
os: ubuntu-22.04
ops: durkheim
- dev: turing
os: ubuntu-22.04
ops: veblen
- dev: church
os: ubuntu-22.04
ops: commons

runs-on: ${{ matrix.env.os }}
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/prepare
with:
devenv: ${{ matrix.env.dev }}
tools: python docker
token: ${{ secrets.GITHUB_TOKEN }}
- run: >-
ansible-playbook stacks.yaml -t build
-e image_storage=${{ env.IMAGE_STORAGE }}
-e purpose=${{ matrix.purpose }}
-e devenv=${{ matrix.env.dev }}
-e opsenv=${{ matrix.env.ops }}
working-directory: bakers/ansible
- uses: actions/[email protected]
with:
name: solution-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stacks/solution/target/image-context
if-no-files-found: ignore

stack-testing:
name: Stack testing (${{ matrix.shard }}, ${{ matrix.purpose }}, ${{ matrix.env.ops }})
timeout-minutes: 15
needs: [stack-building]
strategy:
fail-fast: false
matrix:
purpose: [func]
shard: [0, 1]
env:
- dev: godel
os: ubuntu-20.04
ops: marx
- dev: turing
os: ubuntu-22.04
ops: durkheim
- dev: turing
os: ubuntu-22.04
ops: veblen
- dev: church
os: ubuntu-22.04
ops: commons
runs-on: ${{ matrix.env.os }}
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/prepare
with:
devenv: ${{ matrix.env.dev }}
tools: python java docker
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
continue-on-error: true # it's ok because stack building can be skipped
with:
name: solution-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stacks/solution/target/image-context
- run: >-
ansible-playbook stacks.yaml -t test
-e image_storage=${{ env.IMAGE_STORAGE }}
-e purpose=${{ matrix.purpose }}
-e reminder=${{ matrix.shard }}
-e modulus=2
-e devenv=${{ matrix.env.dev }}
-e opsenv=${{ matrix.env.ops }}
working-directory: bakers/ansible
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
- name: Always empty E2E test report. See https://github.com/orgs/community/discussions/13690
uses: mikepenz/[email protected]
if: ${{ !cancelled() }}
with:
name: e2e-test-report-${{ matrix.shard }}-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: tests/e2e/target/surefire-reports/*.xml
if-no-files-found: ignore

stack-publishing:
name: Stack publishing (${{ matrix.purpose }}, ${{ matrix.env.ops }})
timeout-minutes: 5
needs: [stack-testing]
strategy:
fail-fast: false
matrix:
purpose: [func]
env:
- dev: godel
os: ubuntu-20.04
ops: marx
- dev: turing
os: ubuntu-22.04
ops: durkheim
- dev: turing
os: ubuntu-22.04
ops: veblen
- dev: church
os: ubuntu-22.04
ops: commons
runs-on: ${{ matrix.env.os }}
permissions:
packages: write
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/prepare
with:
devenv: ${{ matrix.env.dev }}
tools: python docker
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
continue-on-error: true # it's ok because stack building can be skipped
with:
name: solution-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stacks/solution/target/image-context
- run: >-
ansible-playbook stacks.yaml -t package
-e image_storage=${{ env.IMAGE_STORAGE }}
-e purpose=${{ matrix.purpose }}
-e opsenv=${{ matrix.env.ops }}
working-directory: bakers/ansible

stack-reporting:
name: Stack reporting
timeout-minutes: 5
needs: [stack-testing]
if: ${{ !cancelled() && (needs.stack-testing.result == 'success' || needs.stack-testing.result == 'failure') }}
runs-on: ubuntu-22.04
permissions:
checks: write
steps:
- uses: actions/[email protected]
with:
path: artifacts
- uses: mikepenz/[email protected]
with:
check_name: E2E test report
report_paths: "artifacts/e2e-test-report-*/**/TEST-*.xml"
require_tests: "${{ needs.stack-testing.result == 'failure' }}"
require_tests: false
fail_on_failure: false
job_summary: false
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package smecalculus.bezmen.construction;

import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static smecalculus.bezmen.configuration.StorageEmEg.storageProps;

import java.util.Random;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import smecalculus.bezmen.configuration.PropsKeeper;
Expand Down Expand Up @@ -37,4 +39,11 @@
// then
verify(validatorMock).validate(expectedProps);
}

@Test
void randomFailingTest() {
if (new Random().nextInt(10) > 5) {
fail("random");

Check failure on line 46 in libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansTest.java

View workflow job for this annotation

GitHub Actions / Unit test report

StorageConfigBeansTest.randomFailingTest

random
Raw output
org.opentest4j.AssertionFailedError: random
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:38)
	at org.junit.jupiter.api.Assertions.fail(Assertions.java:138)
	at smecalculus.bezmen.construction.StorageConfigBeansTest.randomFailingTest(StorageConfigBeansTest.java:46)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
}
}
}
Loading