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

Test/use single instance of config yaml #1

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Apply Calico Rules to LKE
if: always()
run: |
cd scripts && ./lke_calico_rules_e2e.sh
cd e2e_scripts/cloud_security_scripts/lke_calico_rules/ && ./lke_calico_rules_e2e.sh
env:
LINODE_TOKEN: ${{ secrets.DX_LINODE_TOKEN }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Apply Calico Rules to LKE
if: always()
run: |
cd scripts && ./lke_calico_rules_e2e.sh
cd e2e_scripts/cloud_security_scripts/lke_calico_rules/ && ./lke_calico_rules_e2e.sh
env:
LINODE_TOKEN: ${{ secrets.DX_LINODE_TOKEN }}

Expand Down Expand Up @@ -109,12 +109,12 @@ jobs:
- name: Merge all test xmls in output directory
run: |
ls -R tests/output/junit
python tod_scripts/merge_ansible_results.py
python e2e_scripts/tod_scripts/xml_to_obj_storage/ansible_tests/merge_ansible_results.py

- name: Add additional information to XML report
run: |
filename=$(ls | grep -E '^[0-9]{12}_ansible_merged\.xml$')
python tod_scripts/add_to_xml_test_report.py \
python e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/add_gha_info_to_xml.py \
--branch_name "${GITHUB_REF#refs/*/}" \
--gha_run_id "$GITHUB_RUN_ID" \
--gha_run_number "$GITHUB_RUN_NUMBER" \
Expand All @@ -123,7 +123,7 @@ jobs:
- name: Upload test results to the bucket
run: |
filename=$(ls | grep -E '^[0-9]{12}_ansible_merged\.xml$')
python3 tod_scripts/test_report_upload_script.py "${filename}"
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/xml_to_obj.py "${filename}"
env:
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "tod_scripts"]
path = tod_scripts
url = https://github.com/linode/TOD-test-report-uploader.git
[submodule "e2e_scripts"]
path = e2e_scripts
url = https://github.com/linode/dx-e2e-test-scripts
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ integration-test: create-integration-config create-e2e-firewall

create-e2e-firewall:
@echo "Running create e2e firewall playbook..."
@if ansible-playbook scripts/create_e2e_cloud_firewall.yaml > /dev/null; then \
@if e2e_scripts/cloud_security_scripts/cloud_e2e_firewall/ansible_linode/create_e2e_cloud_firewall.yaml > /dev/null; then \
echo "Successfully created e2e firewall"; \
else \
echo "Failed to create e2e firewall"; \
fi

delete-e2e-firewall:
@echo "Running delete e2e firewall playbook..."
@if ansible-playbook scripts/delete_e2e_cloud_firewall.yaml > /dev/null; then \
@if e2e_scripts/cloud_security_scripts/cloud_e2e_firewall/ansible_linode/delete_e2e_cloud_firewall.yaml > /dev/null; then \
echo "Successfully deleted e2e firewall"; \
else \
echo "Failed to delete e2e firewall"; \
Expand Down
1 change: 1 addition & 0 deletions e2e_scripts
Submodule e2e_scripts added at 9240a1
66 changes: 0 additions & 66 deletions scripts/create_e2e_cloud_firewall.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions scripts/delete_e2e_cloud_firewall.yaml

This file was deleted.

78 changes: 0 additions & 78 deletions scripts/lke-policy.yaml

This file was deleted.

60 changes: 0 additions & 60 deletions scripts/lke_calico_rules_e2e.sh

This file was deleted.

25 changes: 20 additions & 5 deletions scripts/test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,34 @@ run_test() {
}

cleanup() {
make delete-e2e-firewall
if [[ -z "$CLEANUP_DONE" ]]; then
make delete-e2e-firewall
CLEANUP_DONE=1
fi
}

# Set trap to ensure cleanup is run on script exit
trap cleanup EXIT

make create-integration-config
make create-e2e-firewall
# Create integration_yaml
if ! make create-integration-config; then
echo "Failed to create integration config..."
exit 1
fi

if ! make create-e2e-firewall; then
echo "Failed to create e2e firewall..."
exit 1
fi

export -f run_test

parallel -j $PARALLEL_JOBS --group --keep-order run_test ::: $(ls tests/integration/targets)
TEST_EXIT_CODE=$?
# Run tests in parallel
if ! parallel -j $PARALLEL_JOBS --group --keep-order run_test ::: $(ls tests/integration/targets); then
TEST_EXIT_CODE=$?
else
TEST_EXIT_CODE=0
fi

cleanup

Expand Down
1 change: 0 additions & 1 deletion tod_scripts
Submodule tod_scripts deleted from e8c8e1
Loading