mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-11 03:57:41 +02:00
Trigger a new code coverage report GitHub Actions CI workflow after successful completion of the CI workflow (#371). Also attempts to stablize the flakey add ROAs UI test (#377).
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
@@ -13,6 +14,7 @@ on:
|
||||
- 'LICENSE'
|
||||
- 'README.md'
|
||||
- 'tests/e2e/**'
|
||||
|
||||
# Hmm, annoying, do we really have to duplicate this?
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
@@ -27,6 +29,7 @@ on:
|
||||
- 'LICENSE'
|
||||
- 'README.md'
|
||||
- 'tests/e2e/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
@@ -35,6 +38,7 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
rust: [stable, 1.45.0, beta]
|
||||
args: ["", "--all-features"]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v1
|
||||
@@ -42,21 +46,5 @@ jobs:
|
||||
uses: hecrj/setup-rust-action@v1
|
||||
with:
|
||||
rust-version: ${{ matrix.rust }}
|
||||
- run: cargo build --verbose
|
||||
- run: cargo test --verbose 2>&1
|
||||
allfeatures:
|
||||
name: allfeatures
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
rust: [stable, 1.45.0, beta]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v1
|
||||
- name: Install Rust
|
||||
uses: hecrj/setup-rust-action@v1
|
||||
with:
|
||||
rust-version: ${{ matrix.rust }}
|
||||
- run: cargo build --verbose --all-features
|
||||
- run: cargo test --verbose --all-features 2>&1
|
||||
- run: cargo build --verbose ${{ matrix.args }}
|
||||
- run: cargo test --verbose ${{ matrix.args }} 2>&1
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
name: Coverage
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["CI"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
coverage:
|
||||
name: coverage
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
rust: [stable]
|
||||
args: ["", "--all-features"]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
# at the time of writing workflow_run.head_commit.id appears to be
|
||||
# the commit that triggered the CI workflow which then triggered us.
|
||||
ref: ${{ github.event.workflow_run.head_commit.id }}
|
||||
- name: Install Rust
|
||||
uses: hecrj/setup-rust-action@v1
|
||||
with:
|
||||
rust-version: ${{ matrix.rust }}
|
||||
- run: cargo install cargo-tarpaulin
|
||||
# use a long timeout with tarpaulin as UI tests have to docker pull the
|
||||
# cypress.io image which can cause a test timeout with the default tarpaulin
|
||||
# timeout of 1 minute.
|
||||
- run: cargo tarpaulin --verbose --out Html --timeout 180 ${{ matrix.args }}
|
||||
- name: Archive code coverage results
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: code-coverage-report ${{ matrix.os }} ${{ matrix.rust }} ${{ matrix.args }}
|
||||
path: tarpaulin-report.html
|
||||
|
||||
@@ -211,6 +211,9 @@ describe('Config File Users with TA', () => {
|
||||
if (ts.o) {
|
||||
cy.contains('Success')
|
||||
cy.contains('Error').should('not.exist')
|
||||
// wait for the parent registration to complete inside Krill and
|
||||
// for the details to appear in the Lagosta UI
|
||||
cy.get('div#tab-parents').click().get('body').contains('Add an additional parent')
|
||||
} else {
|
||||
cy.contains('Success').should('not.exist')
|
||||
cy.contains('Error')
|
||||
@@ -238,6 +241,8 @@ describe('Config File Users with TA', () => {
|
||||
|
||||
add_roa_test_settings.forEach(function (ts) {
|
||||
it('Add ROA for CA ' + ts.ca + ' as ' + ts.d + ' user should ' + (ts.o ? 'succeed' : 'fail'), () => {
|
||||
cy.intercept('GET', '/api/v1/cas/' + ts.ca + '/routes/analysis/full').as('analyzeRoutes')
|
||||
|
||||
cy.visit('/')
|
||||
cy.get('input[placeholder="Your username"]').type(ts.u)
|
||||
cy.get(':password').type(ts.p)
|
||||
@@ -245,6 +250,9 @@ describe('Config File Users with TA', () => {
|
||||
cy.contains(ts.u)
|
||||
cy.contains('Sign In').should('not.exist')
|
||||
|
||||
// wait for Lagosta to finish fetching the route analysis details
|
||||
cy.wait('@analyzeRoutes').its('response.statusCode').should('eq', 200)
|
||||
|
||||
// Add a ROA
|
||||
cy.get('div#tab-roas').click()
|
||||
cy.get('body').then(($body) => {
|
||||
|
||||
Reference in New Issue
Block a user