Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making test workflow more generic #43

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions .github/workflows/kubescape-cli-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ on:
inputs:
DOWNLOAD_ARTIFACT_PATH:
description: 'Download artifact path'
required: true
required: false
type: string
DOWNLOAD_ARTIFACT_KEY_NAME:
description: 'Download artifact Key name'
required: true
required: false
type: string
USE_ARTIFACTS_FILE:
description: 'The base file name that need to be used by "use_artifacts" kwargs flag (systests)'
description: 'The base file name that needs to be used by "use_artifacts" kwargs flag (systests)'
required: false
type: string
ADDITIONAL_KWARGS:
description: 'Additional command line arguments for systest-cli.py'
required: false
type: string
type: string
BINARY_TESTS:
type: string
default: '[ "scan_nsa",
Expand Down Expand Up @@ -134,16 +138,22 @@ jobs:
echo " ${{ matrix.TEST }} " >/tmp/testhistory
cat /tmp/testhistory
source systests_python_env/bin/activate

if [[ -n "${{ steps.download-artifact.outputs.download-path }}" ]]; then
USE_ARTIFACTS="${{steps.download-artifact.outputs.download-path}}/${{ inputs.USE_ARTIFACTS_FILE }}"
ARGS="--kwargs use_artifacts=$USE_ARTIFACTS ks_branch=release"
else
ARGS="--kwargs ks_branch=release"
fi
if [[ -n "${{ inputs.ADDITIONAL_KWARGS }}" ]]; then
ARGS+=" ${{ inputs.ADDITIONAL_KWARGS }}"
fi
python3 systest-cli.py \
-t ${{ matrix.TEST }} \
-b production \
-c CyberArmorTests \
--duration 3 \
--logger DEBUG \
--kwargs ks_branch=release \
use_artifacts=${{steps.download-artifact.outputs.download-path}}/${{ inputs.USE_ARTIFACTS_FILE }}

$ARGS
deactivate

- name: Test Report
Expand Down