mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
Add workflow for running Docker-only acc tests (#18672)
* Add workflow for running Docker-only acc tests * Convert to caller/called workflow * Add comments for posterity and change run trigger * Standardize workflow names and adjust artifact retention time * Consolidate metadata job into test job * Shorten artifact retention time * Standardize filenames * Correct workflow reference * Remove erroneous dependency reference
This commit is contained in:
34
.github/workflows/test-acc-dockeronly-nightly.yml
vendored
Normal file
34
.github/workflows/test-acc-dockeronly-nightly.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: test-go-acceptance-nightly
|
||||
|
||||
on:
|
||||
# Change to nightly cadence once API-credential-requiring tests are added to the jobs
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
VAULT_ACC: 1
|
||||
|
||||
# Currently the jobs here are only for acceptance tests that have no dependencies except for Docker
|
||||
jobs:
|
||||
plugins-database:
|
||||
uses: ./.github/workflows/test-run-go-tests-for-path.yml
|
||||
strategy:
|
||||
matrix:
|
||||
name: [mongodb, mysql, postgresql]
|
||||
with:
|
||||
name: plugins-database-${{ matrix.name }}
|
||||
path: plugins/database/${{ matrix.name }}
|
||||
|
||||
external:
|
||||
uses: ./.github/workflows/test-run-go-tests-for-path.yml
|
||||
strategy:
|
||||
matrix:
|
||||
name: [api, identity, token]
|
||||
with:
|
||||
name: external-${{ matrix.name }}
|
||||
path: vault/external_tests/${{ matrix.name }}
|
||||
|
||||
# Suggestions and tips for adding more acceptance test jobs:
|
||||
# - the job name is up to you, but it should be derived from the path that the tests are found in
|
||||
# - for instance, "plugins-database" is a job for acceptance tests in the plugins/database path
|
||||
# - the path will be used with go test wildcards, but don't include the preceding "./" or following "/..."
|
||||
# - the name parameter is used to construct the log artifact's name, make it something that is related to the path
|
||||
32
.github/workflows/test-run-go-tests-for-path.yml
vendored
Normal file
32
.github/workflows/test-run-go-tests-for-path.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: test-run-go-tests-for-path
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
name:
|
||||
description: 'The name to use that will appear in the output log file artifact'
|
||||
required: true
|
||||
type: string
|
||||
path:
|
||||
description: 'The path to the test without the precedeing "./" or following "/..." e.g. go test -v ./$path/...'
|
||||
required: true
|
||||
type: string
|
||||
# We will need to add the capacity for receiving passed secrets once we get to the tests that require API credentials
|
||||
|
||||
jobs:
|
||||
go-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- id: get-metadata
|
||||
run: echo "go-version=$(cat ./.go-version)" >> $GITHUB_OUTPUT
|
||||
- name: Set Up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ steps.get-metadata.outputs.go-version }}
|
||||
- run: go test -v ./${{ inputs.path }}/... 2>&1 | tee ${{ inputs.name }}.txt
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.name }}-output
|
||||
path: ${{ inputs.name }}.txt
|
||||
retention-days: 2
|
||||
Reference in New Issue
Block a user