This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Test the `local-test-infra` config' | |
on: [push, pull_request] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
shellcheck: | |
name: Shellcheck | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run ShellCheck | |
uses: ludeeus/action-shellcheck@master | |
with: | |
scandir: './scripts' | |
severity: error | |
test-local-test-infra: | |
name: 'Test the `local-test-infra` configuration on k8s cluster' | |
runs-on: ubuntu-22.04 | |
env: | |
TNF_NAMESPACE: tnf | |
PUT_CONTAINER_NAME: test | |
TPP_CONTAINER_NAME: partner | |
DEFAULT_NAMESPACE: default | |
DEFAULT_TIMEOUT: 90s | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Start the k8s cluster | |
uses: ./.github/actions/start-k8s-cluster | |
- name: Create `local-test-infra` OpenShift resources | |
uses: ./.github/actions/create-local-test-infra-resources | |
# $PUT_POD_NAME and $TPP_POD_NAME environment variables are set | |
# during the execution of `create-local-test-infra-resources` | |
# Tests for the test pod (PUT) | |
- name: '(test pod) Test: Check if ping is installed' | |
run: oc exec -i $PUT_POD_NAME -c $PUT_CONTAINER_NAME -- which ping | |
- name: '(test pod) Test: Check if ip is installed' | |
run: oc exec -i $PUT_POD_NAME -c $PUT_CONTAINER_NAME -- which ip | |
- name: '(test pod) Test: Check if ssh is installed' | |
run: oc exec -i $PUT_POD_NAME -c $PUT_CONTAINER_NAME -- which ssh | |
# Cleanup | |
- name: Delete OpenShift resources | |
run: make clean-all | |
- name: 'Test: Check if `make clean` removed all TNF pods' | |
run: '[[ "$(oc get pods -o name | wc -l)" -eq "0" ]]' |