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

chore(ci): more e2e tests #63

Merged
merged 10 commits into from
May 20, 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
57 changes: 57 additions & 0 deletions .github/workflows/test-archive-channel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: test - archive-channel

on:
pull_request:
branches:
- main
paths:
- archive-channel/**
- .github/workflows/test-archive-channel.yml

concurrency:
group: test-archive-channel-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
env:
WORDPRESS_CHART_VERSION: 22.2.8

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
**/package-lock.json

- name: build
run: make package-archive-channel

- name: create-release
id: create-release
uses: replicatedhq/compatibility-actions/create-release@v1
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: replicated-actions-ci # from the Replicated QA team
yaml-dir: ./test/kots-install/yaml
promote-channel: ci-test-archive-channel-${{ github.sha }}

- name: test archive-channel
id: archive-channel
uses: ./archive-channel
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: replicated-actions-ci # from the Replicated QA team
channel-slug: ${{ steps.create-release.outputs.channel-slug }}

- name: archive-channel
if: always()
uses: replicatedhq/compatibility-actions/archive-channel@v1
continue-on-error: true # It could be that the channel is already removed
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: replicated-actions-ci # from the Replicated QA team
channel-slug: ${{ steps.create-release.outputs.channel-slug }}
Comment on lines +42 to +57
Copy link
Member

Choose a reason for hiding this comment

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

If archive-channel is broken, this will result in orphaned channels.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is from the stable branch replicatedhq/compatibility-actions/archive-channel@v1 to avoid orphaned channels. see on line 44 is the actual test

56 changes: 56 additions & 0 deletions .github/workflows/test-archive-customer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: test - archive-customer

on:
pull_request:
branches:
- main
paths:
- archive-customer/**
- .github/workflows/test-archive-customer.yml

concurrency:
group: test-archive-customer-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
env:
WORDPRESS_CHART_VERSION: 22.2.8

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
**/package-lock.json

- name: build
run: make package-archive-customer

- name: create-customer
id: create-customer
uses: replicatedhq/replicated-actions/create-customer@v1
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: replicated-actions-ci # from the Replicated QA team
customer-name: "CI Test Customer - ${{ github.ref_name }} - ${{ github.sha }}"
customer-email: ${{ github.sha }}@example.com
license-type: test

- name: test archive-customer
id: archive-customer
uses: ./archive-customer
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
customer-id: ${{ steps.create-customer.outputs.customer-id }}

- name: archive-customer
if: always()
uses: replicatedhq/compatibility-actions/archive-customer@v1
continue-on-error: true # It could be that the customer is already removed
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
customer-id: ${{ steps.create-customer.outputs.customer-id }}
1 change: 1 addition & 0 deletions .github/workflows/test-create-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- create-cluster/**
- .github/workflows/test-create-cluster.yml

concurrency:
group: test-create-cluster-${{ github.head_ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-create-customer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- create-customer/**
- .github/workflows/test-create-customer.yml

concurrency:
group: test-create-customer-${{ github.head_ref }}
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/test-create-object-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: test - create-object-store

on:
pull_request:
branches:
- main
paths:
- create-object-store/**
- .github/workflows/test-create-object-store.yml

concurrency:
group: test-create-object-store-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
**/package-lock.json

- name: build
run: make package-create-object-store

- name: create-cluster
id: create-cluster
uses: replicatedhq/compatibility-actions/create-cluster@v1
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
kubernetes-distribution: eks
timeout-minutes: 5

- name: test create-object-store
id: create-object-store
uses: ./create-object-store
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
bucket-prefix: ci-test-object-store
timeout-minutes: 5

- name: remove cluster
if: always()
uses: replicatedhq/compatibility-actions/remove-cluster@v1
continue-on-error: true # It could be that the cluster is already removed
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
54 changes: 54 additions & 0 deletions .github/workflows/test-create-postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: test - create-postgres

on:
pull_request:
branches:
- main
paths:
- create-postgres/**
- .github/workflows/test-create-postgres.yml

concurrency:
group: test-create-postgres-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
**/package-lock.json

- name: build
run: make package-create-postgres

- name: create-cluster
id: create-cluster
uses: replicatedhq/compatibility-actions/create-cluster@v1
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
kubernetes-distribution: eks
timeout-minutes: 5

- name: test create-postgres
id: create-postgres
uses: ./create-postgres
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
version: "16.3"
timeout-minutes: 10

- name: remove cluster
if: always()
uses: replicatedhq/compatibility-actions/remove-cluster@v1
continue-on-error: true # It could be that the cluster is already removed
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
3 changes: 2 additions & 1 deletion .github/workflows/test-create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- create-release/**
- .github/workflows/test-create-release.yml

concurrency:
group: test-create-release-${{ github.head_ref }}
Expand Down Expand Up @@ -47,4 +48,4 @@ jobs:
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: replicated-actions-ci # from the Replicated QA team
yaml-dir: ./test/kots-install
yaml-dir: ./test/kots-install/yaml
56 changes: 56 additions & 0 deletions .github/workflows/test-expose-port.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: test - expose-port

on:
pull_request:
branches:
- main
paths:
- expose-port/**
- .github/workflows/test-expose-port.yml

concurrency:
group: test-expose-port-${{ github.head_ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
**/package-lock.json

- name: build
run: make package-expose-port

- name: create-cluster
id: create-cluster
uses: replicatedhq/compatibility-actions/create-cluster@v1
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
kubernetes-distribution: kind
timeout-minutes: 5

- name: test expose-port
Copy link
Member

Choose a reason for hiding this comment

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

Idea: before exposing a port, run a kubectl apply and install nginx with a nodeport service.
After expose-port, verify with curl the exposed port.
Or would this be beyond testing the action?

Copy link
Member Author

Choose a reason for hiding this comment

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

We test this in cmx e2e tests

id: expose-port
uses: ./expose-port
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
port: "30000"
protocols: http,https
wildcard: "true"
timeout-minutes: 5

- name: remove cluster
if: always()
uses: replicatedhq/compatibility-actions/remove-cluster@v1
continue-on-error: true # It could be that the cluster is already removed
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
1 change: 1 addition & 0 deletions .github/workflows/test-helm-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- helm-install/**
- .github/workflows/test-helm-install.yml

concurrency:
group: test-helm-install-${{ github.head_ref }}
Expand Down
38 changes: 35 additions & 3 deletions .github/workflows/test-kots-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- kots-install/**
- .github/workflows/test-kots-install.yml

concurrency:
group: test-kots-install-${{ github.head_ref }}
Expand Down Expand Up @@ -36,7 +37,7 @@ jobs:
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
app-slug: ${{ env.APP_SLUG }}
yaml-dir: ./test/kots-install
yaml-dir: ./test/kots-install/yaml

- name: create-customer
id: create-customer
Expand All @@ -56,14 +57,45 @@ jobs:
kubernetes-distribution: kind
timeout-minutes: 5

- name: test kots-install
id: kots-install
- name: test kots-install / config string
id: kots-install-config-string
uses: ./kots-install
with:
kubeconfig: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
app-slug: ${{ env.APP_SLUG }}/${{ steps.create-release.outputs.channel-slug }}
license-file: ${{ steps.create-customer.outputs.license-file }}
app-version-label: release__${{ steps.create-release.outputs.release-sequence }}
namespace: config-string
config-values: |
apiVersion: kots.io/v1beta1
kind: ConfigValues
metadata:
name: nginx
spec:
values:
api_token:
value: r8yWQ/cUeLVprKGKZb2gpE5IcQ0Tep1iaNwn7078
example_default_value:
default: please change this value
value: testing
hidden_text:
value: lPiIJL1RfL4v/YKzHfnx/9HyR2x4t5wnVxSLmzJlmf12HlqlyBoSfnvd0O+mftiT8h0+kumsBqc=
readonly_text_left:
value: 8WIAQHZW_G
show_text_inputs:
default: "0"
value: "1"

- name: test kots-install / config file
id: kots-install-config-file
uses: ./kots-install
with:
kubeconfig: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
app-slug: ${{ env.APP_SLUG }}/${{ steps.create-release.outputs.channel-slug }}
license-file: ${{ steps.create-customer.outputs.license-file }}
app-version-label: release__${{ steps.create-release.outputs.release-sequence }}
namespace: config-string
config-values: ./test/kots-install/config.yaml

- name: remove cluster
id: remove-cluster
Expand Down
Loading
Loading