From 5718898a83c1317312d4f70c23d3fe635ed47984 Mon Sep 17 00:00:00 2001 From: Nabarun Pal Date: Fri, 28 May 2021 15:45:05 +0530 Subject: [PATCH 1/2] Add GitHub Action workflow for running e2e tests The e2e here uses kind. The eventual goal would be to remove the use of minikube completely and use kind exclusively in conformance to general Kubernetes upstream usage. - Add kind cluster configs for all supported Kubernetes versions - Add GH Action workflows for end to end testing Signed-off-by: Nabarun Pal --- .github/workflows/e2e-master.yaml | 44 +++++++++++++++++++ .github/workflows/e2e-release-11.0.yaml | 44 +++++++++++++++++++ .github/workflows/e2e-release-12.0.yaml | 44 +++++++++++++++++++ .github/workflows/e2e-release-17.0.yaml | 44 +++++++++++++++++++ .github/workflows/e2e-release-18.0.yaml | 44 +++++++++++++++++++ .../workflows/kind-configs/cluster-1.15.yaml | 7 +++ .../workflows/kind-configs/cluster-1.16.yaml | 7 +++ .../workflows/kind-configs/cluster-1.17.yaml | 7 +++ .../workflows/kind-configs/cluster-1.18.yaml | 7 +++ 9 files changed, 248 insertions(+) create mode 100644 .github/workflows/e2e-master.yaml create mode 100644 .github/workflows/e2e-release-11.0.yaml create mode 100644 .github/workflows/e2e-release-12.0.yaml create mode 100644 .github/workflows/e2e-release-17.0.yaml create mode 100644 .github/workflows/e2e-release-18.0.yaml create mode 100644 .github/workflows/kind-configs/cluster-1.15.yaml create mode 100644 .github/workflows/kind-configs/cluster-1.16.yaml create mode 100644 .github/workflows/kind-configs/cluster-1.17.yaml create mode 100644 .github/workflows/kind-configs/cluster-1.18.yaml diff --git a/.github/workflows/e2e-master.yaml b/.github/workflows/e2e-master.yaml new file mode 100644 index 0000000000..3b07f5c99f --- /dev/null +++ b/.github/workflows/e2e-master.yaml @@ -0,0 +1,44 @@ +name: End to End Tests - master + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Create Kind Cluster + uses: helm/kind-action@v1.1.0 + with: + cluster_name: kubernetes-python-e2e-master-${{ matrix.python-version }} + # The kind version to be used to spin the cluster up + # this needs to be updated whenever a new Kind version is released + version: v0.11.1 + # Update the config here whenever a new client snapshot is performed + # This would eventually point to cluster with the latest Kubernetes version + # as we sync with Kubernetes upstream + config: .github/workflows/kind-configs/cluster-1.18.yaml + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2.1.3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install -r test-requirements.txt + - name: Install package + run: python -m pip install -e . + - name: Run End to End tests + run: pytest -vvv -s kubernetes/e2e_test diff --git a/.github/workflows/e2e-release-11.0.yaml b/.github/workflows/e2e-release-11.0.yaml new file mode 100644 index 0000000000..46842873a7 --- /dev/null +++ b/.github/workflows/e2e-release-11.0.yaml @@ -0,0 +1,44 @@ +name: End to End Tests - release-11.0 + +on: + push: + branches: + - release-11.0 + pull_request: + branches: + - release-11.0 + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Create Kind Cluster + uses: helm/kind-action@v1.1.0 + with: + cluster_name: kubernetes-python-e2e-release-11.0-${{ matrix.python-version }} + # The kind version to be used to spin the cluster up + # this needs to be updated whenever a new Kind version is released + version: v0.11.1 + # Update the config here whenever a new client snapshot is performed + # This would eventually point to cluster with the latest Kubernetes version + # as we sync with Kubernetes upstream + config: .github/workflows/kind-configs/cluster-1.15.yaml + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2.1.3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install -r test-requirements.txt + - name: Install package + run: python -m pip install -e . + - name: Run End to End tests + run: pytest -vvv -s kubernetes/e2e_test diff --git a/.github/workflows/e2e-release-12.0.yaml b/.github/workflows/e2e-release-12.0.yaml new file mode 100644 index 0000000000..fc44dea82a --- /dev/null +++ b/.github/workflows/e2e-release-12.0.yaml @@ -0,0 +1,44 @@ +name: End to End Tests - release-12.0 + +on: + push: + branches: + - release-12.0 + pull_request: + branches: + - release-12.0 + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Create Kind Cluster + uses: helm/kind-action@v1.1.0 + with: + cluster_name: kubernetes-python-e2e-release-12.0-${{ matrix.python-version }} + # The kind version to be used to spin the cluster up + # this needs to be updated whenever a new Kind version is released + version: v0.11.1 + # Update the config here whenever a new client snapshot is performed + # This would eventually point to cluster with the latest Kubernetes version + # as we sync with Kubernetes upstream + config: .github/workflows/kind-configs/cluster-1.16.yaml + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2.1.3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install -r test-requirements.txt + - name: Install package + run: python -m pip install -e . + - name: Run End to End tests + run: pytest -vvv -s kubernetes/e2e_test diff --git a/.github/workflows/e2e-release-17.0.yaml b/.github/workflows/e2e-release-17.0.yaml new file mode 100644 index 0000000000..10f5dfca1b --- /dev/null +++ b/.github/workflows/e2e-release-17.0.yaml @@ -0,0 +1,44 @@ +name: End to End Tests - release-17.0 + +on: + push: + branches: + - release-17.0 + pull_request: + branches: + - release-17.0 + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Create Kind Cluster + uses: helm/kind-action@v1.1.0 + with: + cluster_name: kubernetes-python-e2e-release-17.0-${{ matrix.python-version }} + # The kind version to be used to spin the cluster up + # this needs to be updated whenever a new Kind version is released + version: v0.11.1 + # Update the config here whenever a new client snapshot is performed + # This would eventually point to cluster with the latest Kubernetes version + # as we sync with Kubernetes upstream + config: .github/workflows/kind-configs/cluster-1.17.yaml + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2.1.3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install -r test-requirements.txt + - name: Install package + run: python -m pip install -e . + - name: Run End to End tests + run: pytest -vvv -s kubernetes/e2e_test diff --git a/.github/workflows/e2e-release-18.0.yaml b/.github/workflows/e2e-release-18.0.yaml new file mode 100644 index 0000000000..e372f58f8f --- /dev/null +++ b/.github/workflows/e2e-release-18.0.yaml @@ -0,0 +1,44 @@ +name: End to End Tests - release-18.0 + +on: + push: + branches: + - release-18.0 + pull_request: + branches: + - release-18.0 + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Create Kind Cluster + uses: helm/kind-action@v1.1.0 + with: + cluster_name: kubernetes-python-e2e-release-18.0-${{ matrix.python-version }} + # The kind version to be used to spin the cluster up + # this needs to be updated whenever a new Kind version is released + version: v0.11.1 + # Update the config here whenever a new client snapshot is performed + # This would eventually point to cluster with the latest Kubernetes version + # as we sync with Kubernetes upstream + config: .github/workflows/kind-configs/cluster-1.18.yaml + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2.1.3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install -r test-requirements.txt + - name: Install package + run: python -m pip install -e . + - name: Run End to End tests + run: pytest -vvv -s kubernetes/e2e_test diff --git a/.github/workflows/kind-configs/cluster-1.15.yaml b/.github/workflows/kind-configs/cluster-1.15.yaml new file mode 100644 index 0000000000..caee5e7759 --- /dev/null +++ b/.github/workflows/kind-configs/cluster-1.15.yaml @@ -0,0 +1,7 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: +- role: control-plane + image: kindest/node:v1.15.12@sha256:b920920e1eda689d9936dfcf7332701e80be12566999152626b2c9d730397a95 +- role: worker + image: kindest/node:v1.15.12@sha256:b920920e1eda689d9936dfcf7332701e80be12566999152626b2c9d730397a95 diff --git a/.github/workflows/kind-configs/cluster-1.16.yaml b/.github/workflows/kind-configs/cluster-1.16.yaml new file mode 100644 index 0000000000..36dfc9401f --- /dev/null +++ b/.github/workflows/kind-configs/cluster-1.16.yaml @@ -0,0 +1,7 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: +- role: control-plane + image: kindest/node:v1.16.15@sha256:83067ed51bf2a3395b24687094e283a7c7c865ccc12a8b1d7aa673ba0c5e8861 +- role: worker + image: kindest/node:v1.16.15@sha256:83067ed51bf2a3395b24687094e283a7c7c865ccc12a8b1d7aa673ba0c5e8861 diff --git a/.github/workflows/kind-configs/cluster-1.17.yaml b/.github/workflows/kind-configs/cluster-1.17.yaml new file mode 100644 index 0000000000..f564f001b2 --- /dev/null +++ b/.github/workflows/kind-configs/cluster-1.17.yaml @@ -0,0 +1,7 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: +- role: control-plane + image: kindest/node:v1.17.17@sha256:66f1d0d91a88b8a001811e2f1054af60eef3b669a9a74f9b6db871f2f1eeed00 +- role: worker + image: kindest/node:v1.17.17@sha256:66f1d0d91a88b8a001811e2f1054af60eef3b669a9a74f9b6db871f2f1eeed00 diff --git a/.github/workflows/kind-configs/cluster-1.18.yaml b/.github/workflows/kind-configs/cluster-1.18.yaml new file mode 100644 index 0000000000..88430383d0 --- /dev/null +++ b/.github/workflows/kind-configs/cluster-1.18.yaml @@ -0,0 +1,7 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: +- role: control-plane + image: kindest/node:v1.18.19@sha256:7af1492e19b3192a79f606e43c35fb741e520d195f96399284515f077b3b622c +- role: worker + image: kindest/node:v1.18.19@sha256:7af1492e19b3192a79f606e43c35fb741e520d195f96399284515f077b3b622c From b7a612bc7307e210c06dee8f15400eb377ebfe29 Mon Sep 17 00:00:00 2001 From: Nabarun Pal Date: Sun, 6 Jun 2021 11:40:05 +0530 Subject: [PATCH 2/2] Deactivate e2e tests on Travis Signed-off-by: Nabarun Pal --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index c54d6cf8af..883874055f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,20 +32,12 @@ jobs: env: TOXENV=docs - python: 3.6 env: TOXENV=py36 - - python: 3.6 - env: TOXENV=py36-functional - python: 3.7 env: TOXENV=py37 - - python: 3.7 - env: TOXENV=py37-functional - python: 3.8 env: TOXENV=py38 - - python: 3.8 - env: TOXENV=py38-functional - python: 3.9 env: TOXENV=py39 - - python: 3.9 - env: TOXENV=py39-functional - stage: deploy script: skip deploy: