-
Notifications
You must be signed in to change notification settings - Fork 44
152 lines (139 loc) · 4.79 KB
/
02-e2e-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: 02-E2E Test helm chart
on:
workflow_dispatch:
inputs:
BRANCH:
description: 'helm chart branch name'
required: false
default: 'main'
type: string
TESTS_BRANCH:
description: 'tests branch name'
required: false
default: 'master'
type: string
KS_BRANCH:
required: false
default: 'release'
type: string
description: 'kubescape branch name'
workflow_call:
inputs:
BRANCH:
required: false
default: 'main'
type: string
description: 'helm chart branch name'
TESTS_BRANCH:
required: false
default: 'master'
type: string
description: 'tests branch name'
KS_BRANCH:
required: false
default: 'release'
type: string
description: 'kubescape branch name'
jobs:
e2e-test:
strategy:
fail-fast: false
matrix:
test: [
relevant_data_is_appended,
relevantCVEs,
relevancy_disabled_installation,
relevancy_storage_disabled,
relevancy_enabled_stop_sniffing,
relevancy_large_image,
relevancy_extra_large_image,
relevancy_fix_vuln,
relevancy_python,
relevancy_golang,
relevancy_java,
relevancy_java_and_python,
relevancy_golang_dynamic,
# relevancy_multiple_containers,
vuln_scan_proxy,
vuln_scan_trigger_scan_public_registry,
vuln_scan_trigger_scan_public_registry_excluded,
vuln_scan_trigger_scan_private_quay_registry,
vuln_scan_triggering_with_cron_job,
#registry_scanning_triggering_with_cron_job,
vuln_scan_test_public_registry_connectivity_by_backend,
vuln_scan_test_public_registry_connectivity_excluded_by_backend,
ks_microservice_create_2_cronjob_mitre_and_nsa_proxy,
ks_microservice_triggering_with_cron_job,
ks_microservice_update_cronjob_schedule,
ks_microservice_delete_cronjob,
ks_microservice_create_2_cronjob_mitre_and_nsa,
ks_microservice_ns_creation,
ks_microservice_on_demand,
ks_microservice_mitre_framework_on_demand,
ks_microservice_nsa_and_mitre_framework_demand,
scan_compliance_score,
network_policy,
network_policy_data_appended,
network_policy_pod_restarted,
network_policy_multiple_replicas,
network_policy_known_servers,
synchronizer,
synchronizer_reconciliation,
synchronizer_proxy,
# synchronizer_kubescape_crds,
synchronizer_race_condition,
# basic_incident_presented
]
runs-on: ubuntu-latest
steps:
# - name: echo GitHub var - dev
# id: github_context_step
# run: echo '${{ toJSON(github) }}'
- name: Checkout systests repo
uses: actions/checkout@v3
with:
repository: armosec/system-tests
ref: ${{ inputs.TESTS_BRANCH }}
path: .
- uses: actions/setup-python@v4
name: installing python 3.8.13
with:
python-version: '3.8.13'
cache: 'pip'
- name: create env
run: ./create_env.sh
- name: Generate uuid
id: uuid
run: |
echo "RANDOM_UUID=systests-$(uuidgen)" >> $GITHUB_OUTPUT
- name: Create k8s Kind Cluster
id: kind-cluster-install
uses: helm/kind-action@v1.10.0
with:
cluster_name: ${{ steps.uuid.outputs.RANDOM_UUID }}
- name: run-tests
env:
CUSTOMER: ${{ secrets.CUSTOMER }}
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
CLIENT_ID: ${{ secrets.CLIENT_ID_PROD }}
SECRET_KEY: ${{ secrets.SECRET_KEY_PROD }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
echo "Test history:"
echo " ${{ matrix.test }} " >/tmp/testhistory
cat /tmp/testhistory
source systests_python_env/bin/activate
python3 systest-cli.py \
-t ${{ matrix.test }} \
-b production \
-c CyberArmorTests \
--logger DEBUG \
--kwargs helm_branch=${{ inputs.BRANCH }} ks_branch=${{ inputs.KS_BRANCH }}
deactivate
- name: Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: '**/results_xml_format/**.xml'