22 pull_request :
33 workflow_dispatch :
44 inputs :
5- test_path :
6- description : ' Enter specific test path . E.g. linode_client/test_linode_client.py, models/test_account.py '
5+ test_suite :
6+ description : ' Enter specific test suite . E.g. domain, linode_client '
77 required : false
88 sha :
99 description : ' The hash value of the commit.'
2626 - uses : actions-ecosystem/action-regex-match@v2
2727 id : validate-tests
2828 with :
29- text : ${{ inputs.test_path }}
29+ text : ${{ inputs.test_suite }}
3030 regex : ' [^a-z0-9-:.\/_]' # Tests validation
3131 flags : gi
3232
7171 - name : Install Python deps
7272 run : pip install -U setuptools wheel boto3 certifi
7373
74+ - name : Download kubectl and calicoctl for LKE clusters
75+ run : |
76+ curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
77+ curl -LO "https://github.com/projectcalico/calico/releases/download/v3.25.0/calicoctl-linux-amd64"
78+ chmod +x calicoctl-linux-amd64 kubectl
79+ mv calicoctl-linux-amd64 /usr/local/bin/calicoctl
80+ mv kubectl /usr/local/bin/kubectl
81+
7482 - name : Install Python SDK
7583 run : make dev-install
7684 env :
@@ -80,26 +88,28 @@ jobs:
8088 run : |
8189 timestamp=$(date +'%Y%m%d%H%M')
8290 report_filename="${timestamp}_sdk_test_report.xml"
83- status=0
84- if ! python3 -m pytest test/integration/${INTEGRATION_TEST_PATH} --disable-warnings --junitxml="${report_filename}"; then
85- echo "EXIT_STATUS=1" >> $GITHUB_ENV
86- fi
91+ make testint TEST_ARGS="--junitxml=${report_filename}" TEST_SUITE="${{ github.event.inputs.test_suite }}"
92+ env :
93+ LINODE_TOKEN : ${{ secrets.LINODE_TOKEN }}
94+
95+ - name : Apply Calico Rules to LKE
96+ if : always()
97+ run : |
98+ cd scripts && ./lke_calico_rules_e2e.sh
8799 env :
88100 LINODE_TOKEN : ${{ secrets.LINODE_TOKEN }}
89101
90- - name : Add additional information to XML report
102+ - name : Upload test results
103+ if : always()
91104 run : |
92105 filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
93106 python tod_scripts/add_to_xml_test_report.py \
94107 --branch_name "${GITHUB_REF#refs/*/}" \
95108 --gha_run_id "$GITHUB_RUN_ID" \
96109 --gha_run_number "$GITHUB_RUN_NUMBER" \
97110 --xmlfile "${filename}"
98-
99- - name : Upload test results
100- run : |
101- report_filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
102- python3 tod_scripts/test_report_upload_script.py "${report_filename}"
111+ sync
112+ python3 tod_scripts/test_report_upload_script.py "${filename}"
103113 env :
104114 LINODE_CLI_OBJ_ACCESS_KEY : ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
105115 LINODE_CLI_OBJ_SECRET_KEY : ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
@@ -131,12 +141,3 @@ jobs:
131141 conclusion: process.env.conclusion
132142 });
133143 return result;
134-
135- - name : Test Execution Status Handler
136- run : |
137- if [[ "$EXIT_STATUS" != 0 ]]; then
138- echo "Test execution contains failure(s)"
139- exit $EXIT_STATUS
140- else
141- echo "Tests passed!"
142- fi
0 commit comments