Skip to content

Commit 93c6724

Browse files
authored
Adjust pre-main workflow to remove script (#456)
1 parent aaa9032 commit 93c6724

File tree

1 file changed

+37
-30
lines changed

1 file changed

+37
-30
lines changed

.github/workflows/pre-main.yml

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,12 @@ name: Test Incoming Changes
88
workflow_dispatch:
99
env:
1010
REGISTRY: quay.io
11-
TNF_IMAGE_NAME: testnetworkfunction/cnf-certification-test
12-
TNF_IMAGE_TAG: unstable
13-
TNF_CONTAINER_CLIENT: docker
14-
TNF_NON_INTRUSIVE_ONLY: false
15-
TNF_ALLOW_PREFLIGHT_INSECURE: false
16-
TNF_DISABLE_CONFIG_AUTODISCOVER: false
17-
TNF_CONFIG_DIR: /tmp/tnf/config
18-
TNF_OUTPUT_DIR: /tmp/tnf/output
19-
TNF_SRC_URL: 'https://github.com/${{ github.repository }}'
20-
TESTING_CMD_PARAMS: '-n host -i ${REGISTRY}/${TNF_IMAGE_NAME}:${TNF_IMAGE_TAG} -t ${TNF_CONFIG_DIR} -o ${TNF_OUTPUT_DIR}'
21-
TNF_SMOKE_TESTS_LOG_LEVEL: trace
22-
ON_DEMAND_DEBUG_PODS: false
11+
CERTSUITE_IMAGE_NAME: testnetworkfunction/cnf-certification-test
12+
CERTSUITE_IMAGE_TAG: unstable
13+
CERTSUITE_CONFIG_DIR: /tmp/certsuite/config
14+
CERTSUITE_OUTPUT_DIR: /tmp/certsuite/output
2315
TERM: xterm-color
16+
SMOKE_TESTS_LOG_LEVEL: debug
2417
SMOKE_TESTS_LABELS_FILTER: all
2518
jobs:
2619
linters:
@@ -117,37 +110,51 @@ jobs:
117110
repository: test-network-function/cnf-certification-test
118111
path: cnf-certification-test
119112

120-
- name: Create required TNF config files and directories
113+
- name: Create required Certsuite config files and directories
121114
run: |
122-
mkdir -p $TNF_CONFIG_DIR $TNF_OUTPUT_DIR
123-
cp cnf-certification-test/*.yml $TNF_CONFIG_DIR
115+
mkdir -p $CERTSUITE_CONFIG_DIR $CERTSUITE_OUTPUT_DIR
116+
cp /home/runner/.kube/config $CERTSUITE_CONFIG_DIR/kubeconfig
117+
cp /home/runner/.docker/config $CERTSUITE_CONFIG_DIR/dockerconfig
118+
cp cnf-certification-test/*.yml $CERTSUITE_CONFIG_DIR
124119
shell: bash
125120
working-directory: cnf-certification-test
126121

127122
- name: 'Test: Run without any TS, just get diagnostic information'
128-
run: TNF_LOG_LEVEL=${TNF_SMOKE_TESTS_LOG_LEVEL} ./run-tnf-container.sh ${{ env.TESTING_CMD_PARAMS }}
123+
run: |
124+
docker run --rm --network host \
125+
-v $CERTSUITE_CONFIG_DIR:/usr/certsuite/config:Z \
126+
-v $CERTSUITE_OUTPUT_DIR:/usr/certsuite/output:Z \
127+
${REGISTRY}/${CERTSUITE_IMAGE_NAME}:${CERTSUITE_IMAGE_TAG} \
128+
certsuite run \
129+
--output-dir=/usr/certsuite/output \
130+
--preflight-dockerconfig=/usr/certsuite/config/dockerconfig \
131+
--offline-db=/usr/offline-db \
132+
--log-level=${SMOKE_TESTS_LOG_LEVEL} \
133+
--config-file=/usr/certsuite/config/tnf_config.yml \
134+
--kubeconfig=/usr/certsuite/config/kubeconfig \
129135
working-directory: cnf-certification-test
130136

131137
- name: 'Test: Run Smoke Tests in a TNF container'
132-
run: TNF_LOG_LEVEL=${TNF_SMOKE_TESTS_LOG_LEVEL} ./run-tnf-container.sh ${{ env.TESTING_CMD_PARAMS }} -l "${SMOKE_TESTS_LABELS_FILTER}"
138+
run: |
139+
docker run --rm --network host \
140+
-v $CERTSUITE_CONFIG_DIR:/usr/certsuite/config:Z \
141+
-v $CERTSUITE_OUTPUT_DIR:/usr/certsuite/output:Z \
142+
${REGISTRY}/${CERTSUITE_IMAGE_NAME}:${CERTSUITE_IMAGE_TAG} \
143+
certsuite run \
144+
--output-dir=/usr/certsuite/output \
145+
--preflight-dockerconfig=/usr/certsuite/config/dockerconfig \
146+
--offline-db=/usr/offline-db \
147+
--enable-data-collection=true \
148+
--log-level=${SMOKE_TESTS_LOG_LEVEL} \
149+
--config-file=/usr/certsuite/config/tnf_config.yml \
150+
--kubeconfig=/usr/certsuite/config/kubeconfig \
151+
--label-filter="${SMOKE_TESTS_LABELS_FILTER}"
133152
working-directory: cnf-certification-test
134153

135154
- name: Build the TNF tool
136155
run: make build-certsuite-tool
137156
working-directory: cnf-certification-test
138157

139158
- name: Check the smoke test results against the expected results template
140-
run: ./certsuite check results --log-file="${TNF_OUTPUT_DIR}"/certsuite.log
159+
run: ./certsuite check results --log-file="${CERTSUITE_OUTPUT_DIR}"/certsuite.log
141160
working-directory: cnf-certification-test
142-
143-
- name: Upload container test results as an artifact
144-
uses: actions/upload-artifact@v4
145-
if: always()
146-
with:
147-
name: smoke-tests-container
148-
path: |
149-
${{ env.TNF_OUTPUT_DIR }}/*.xml
150-
${{ env.TNF_OUTPUT_DIR }}/claim.json
151-
${{ env.TNF_OUTPUT_DIR }}/claimjson.js
152-
${{ env.TNF_OUTPUT_DIR }}/results.html
153-
${{ env.TNF_OUTPUT_DIR }}/certsuite.log

0 commit comments

Comments
 (0)