Add support for integration tests in the tests/integration dir (#253)
* Add support for integration tests in the tests/integration dir Signed-off-by: Kevin Fox <[email protected]> * Fix split issue and typo Signed-off-by: Kevin Fox <[email protected]> --------- Signed-off-by: Kevin Fox <[email protected]>
This commit is contained in:
@@ -45,7 +45,7 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/[email protected]
|
uses: actions/[email protected]
|
||||||
|
|
||||||
- id: set-matrix
|
- id: set-matrix-example
|
||||||
name: Collect all examples
|
name: Collect all examples
|
||||||
run: |
|
run: |
|
||||||
examples="$(find examples -maxdepth 2 -type f -name run-tests.sh | xargs -I % dirname %)"
|
examples="$(find examples -maxdepth 2 -type f -name run-tests.sh | xargs -I % dirname %)"
|
||||||
@@ -53,8 +53,17 @@ jobs:
|
|||||||
echo "${examples_json}"
|
echo "${examples_json}"
|
||||||
echo "examples=$examples_json" >>"$GITHUB_OUTPUT"
|
echo "examples=$examples_json" >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- id: set-matrix-integration
|
||||||
|
name: Collect all integration tests
|
||||||
|
run: |
|
||||||
|
integrationtests="$(find tests/integration -maxdepth 2 -type f -name run-tests.sh | xargs -I % dirname %)"
|
||||||
|
integrationtests_json="$(echo "$integrationtests" | jq -c --slurp --raw-input 'split("\n") | map(select(. != ""))')"
|
||||||
|
echo "${integrationtests_json}"
|
||||||
|
echo "integrationtests=$integrationtests_json" >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
examples: ${{ steps.set-matrix.outputs.examples }}
|
examples: ${{ steps.set-matrix-example.outputs.examples }}
|
||||||
|
integrationtests: ${{ steps.set-matrix-integration.outputs.integrationtests }}
|
||||||
|
|
||||||
example-test:
|
example-test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@@ -74,6 +83,24 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- run: 'echo "Skipping example-test"'
|
- run: 'echo "Skipping example-test"'
|
||||||
|
|
||||||
|
integration-test:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
needs:
|
||||||
|
- build-matrix
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
k8s:
|
||||||
|
- v1.28.0
|
||||||
|
- v1.27.3
|
||||||
|
- v1.26.6
|
||||||
|
example:
|
||||||
|
- ${{ fromJson(needs.build-matrix.outputs.integrationtests) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- run: 'echo "Skipping integration-test"'
|
||||||
|
|
||||||
upgrade-test:
|
upgrade-test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/[email protected]
|
uses: actions/[email protected]
|
||||||
|
|
||||||
- id: set-matrix
|
- id: set-matrix-example
|
||||||
name: Collect all examples
|
name: Collect all examples
|
||||||
run: |
|
run: |
|
||||||
examples="$(find examples -maxdepth 2 -type f -name run-tests.sh | xargs -I % dirname %)"
|
examples="$(find examples -maxdepth 2 -type f -name run-tests.sh | xargs -I % dirname %)"
|
||||||
@@ -195,8 +195,17 @@ jobs:
|
|||||||
echo "${examples_json}"
|
echo "${examples_json}"
|
||||||
echo "examples=$examples_json" >>"$GITHUB_OUTPUT"
|
echo "examples=$examples_json" >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- id: set-matrix-integration
|
||||||
|
name: Collect all integration tests
|
||||||
|
run: |
|
||||||
|
integrationtests="$(find tests/integration -maxdepth 2 -type f -name run-tests.sh | xargs -I % dirname %)"
|
||||||
|
integrationtests_json="$(echo "$integrationtests" | jq -c --slurp --raw-input 'split("\n") | map(select(. != ""))')"
|
||||||
|
echo "${integrationtests_json}"
|
||||||
|
echo "integrationtests=$integrationtests_json" >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
examples: ${{ steps.set-matrix.outputs.examples }}
|
examples: ${{ steps.set-matrix-example.outputs.examples }}
|
||||||
|
integrationtests: ${{ steps.set-matrix-integration.outputs.integrationtests }}
|
||||||
|
|
||||||
example-test:
|
example-test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@@ -249,6 +258,52 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
${{ matrix.example }}/run-tests.sh
|
${{ matrix.example }}/run-tests.sh
|
||||||
|
|
||||||
|
integration-test:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
needs:
|
||||||
|
- lint-chart
|
||||||
|
- build-matrix
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
k8s:
|
||||||
|
- v1.28.0
|
||||||
|
- v1.27.3
|
||||||
|
- v1.26.6
|
||||||
|
integrationtest:
|
||||||
|
- ${{ fromJson(needs.build-matrix.outputs.integrationtests) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/[email protected]
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/[email protected]
|
||||||
|
with:
|
||||||
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
|
- name: Create kind cluster
|
||||||
|
uses: helm/[email protected]
|
||||||
|
# Only build a kind cluster if there are chart changes to test.
|
||||||
|
with:
|
||||||
|
version: ${{ env.KIND_VERSION }}
|
||||||
|
node_image: kindest/node:v1.26.4
|
||||||
|
config: .github/kind/conf/kind-config.yaml
|
||||||
|
verbosity: 1
|
||||||
|
|
||||||
|
- name: Install and test integration
|
||||||
|
run: |
|
||||||
|
kubectl create namespace spire-server
|
||||||
|
helm install -n spire-server spire-crds charts/spire-crds
|
||||||
|
${{ matrix.integrationtest }}/run-tests.sh
|
||||||
|
|
||||||
upgrade-test:
|
upgrade-test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user