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

Add GitHub workflows for testing #1195

Merged
merged 1 commit into from
Sep 9, 2020
Merged

Conversation

mogren
Copy link
Contributor

@mogren mogren commented Sep 4, 2020

What type of PR is this?

feature

Which issue(s) this PR fixes:

We want to enable e2e tests on PRs before they are merged. (This PR replaces #1194 with a simpler solution)

What this PR does:

  • Add a standard unit test run for all PRs
  • Add integration tests for PRs that run on on a manual workflow trigger
  • Add a nightly test run.

To do this we use the recently added pull_request_target that always runs in the context of the base repository for the PR.

The manual workflow is triggered by a workflow_dispatch event that is only available to users with write permissions to the repo.

This PR also does the first step of #786, disabling the NLB and ALB tests on PR e2e tests, but run them in the nightly tests by setting RUN_TESTER_LB_ADDONS=true.

Testing:

Manual e2 run triggered:
https://github.com/mogren/amazon-vpc-cni-k8s/runs/1074412555?check_suite_focus=true

Tests on in-repo branch PRs works:
https://github.com/mogren/amazon-vpc-cni-k8s/runs/1069555238?check_suite_focus=true

Nightly test run:
https://github.com/mogren/amazon-vpc-cni-k8s/runs/1072813881?check_suite_focus=true

The changes to the run-integration-tests.sh script still works with CircleCI:
https://app.circleci.com/pipelines/github/mogren/amazon-vpc-cni-k8s/883/workflows/33505350-bd9a-437b-99e0-526e678ae4e8/jobs/1787

Automation added to e2e:
This PR runs the e2e tests as GitHub workflows

Will this break upgrades and downgrades. Has it been tested?:
It will not

Does this require config changes:
No CNI config changes, but it does require adding self hosted runners to the aws/amazon-vpc-cni-k8s repo.

Does this PR introduce a user-facing change?:
No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mogren mogren force-pushed the manual-pr-tests branch 2 times, most recently from 2c4c935 to 86bb210 Compare September 4, 2020 23:14
@mogren mogren added the testing label Sep 5, 2020
@fawadkhaliq
Copy link

Looks good overall. Let's add clean up as part of workflow here so anything (e.g Docker images) created as part of the test are cleaned up (from the runner) at the end of the test. Alternatively, you could have this cleaned up before every test run

@mogren mogren force-pushed the manual-pr-tests branch 2 times, most recently from a554ccb to a524ec5 Compare September 8, 2020 22:20
@mogren
Copy link
Contributor Author

mogren commented Sep 8, 2020

Looks good overall. Let's add clean up as part of workflow here so anything (e.g Docker images) created as part of the test are cleaned up (from the runner) at the end of the test. Alternatively, you could have this cleaned up before every test run

Sounds good to clean them up before running the e2e tests. Added a docker image prune -f run:

 Clean up stale docker images
  docker image prune -f
Total reclaimed space: 0B

Copy link

@fawadkhaliq fawadkhaliq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Adding a standard unit test, integration tests for PRs and a nightly
test run
@mogren mogren merged commit 08cc3d4 into aws:master Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants