From 3c50431a09cb141dd2ccfd480b4769f92d19b52b Mon Sep 17 00:00:00 2001 From: Hidetake Iwata Date: Mon, 22 Jun 2020 16:22:03 +0900 Subject: [PATCH] Refactor: rename to system test (#314) --- .../workflows/{acceptance-test.yaml => system-test.yaml} | 6 +++--- .gitignore | 2 +- README.md | 4 ++-- ...acceptance-test-diagram.svg => system-test-diagram.svg} | 0 {acceptance_test => system_test}/Makefile | 4 ++-- {acceptance_test => system_test}/README.md | 7 +++---- {acceptance_test => system_test}/chromelogin/main.go | 0 {acceptance_test => system_test}/cluster.yaml | 2 +- {acceptance_test => system_test}/dex.yaml | 0 {acceptance_test => system_test}/openssl.cnf | 0 10 files changed, 12 insertions(+), 13 deletions(-) rename .github/workflows/{acceptance-test.yaml => system-test.yaml} (89%) rename docs/{acceptance-test-diagram.svg => system-test-diagram.svg} (100%) rename {acceptance_test => system_test}/Makefile (97%) rename {acceptance_test => system_test}/README.md (87%) rename {acceptance_test => system_test}/chromelogin/main.go (100%) rename {acceptance_test => system_test}/cluster.yaml (90%) rename {acceptance_test => system_test}/dex.yaml (100%) rename {acceptance_test => system_test}/openssl.cnf (100%) diff --git a/.github/workflows/acceptance-test.yaml b/.github/workflows/system-test.yaml similarity index 89% rename from .github/workflows/acceptance-test.yaml rename to .github/workflows/system-test.yaml index 462bec7..d447d02 100644 --- a/.github/workflows/acceptance-test.yaml +++ b/.github/workflows/system-test.yaml @@ -1,6 +1,6 @@ on: [push] jobs: - acceptance-test: + system-test: # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners#ubuntu-1804-lts runs-on: ubuntu-18.04 steps: @@ -25,5 +25,5 @@ jobs: - run: sudo apt update - run: sudo apt install -y libnss3-tools - run: echo '127.0.0.1 dex-server' | sudo tee -a /etc/hosts - - run: make -C acceptance_test -j3 setup - - run: make -C acceptance_test test + - run: make -C system_test -j3 setup + - run: make -C system_test test diff --git a/.gitignore b/.gitignore index 508ceb0..0e7867f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /.idea -/acceptance_test/output/ +/system_test/output/ /dist/output /coverage.out diff --git a/README.md b/README.md index 68faf61..c9c1118 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# kubelogin [![CircleCI](https://circleci.com/gh/int128/kubelogin.svg?style=shield)](https://circleci.com/gh/int128/kubelogin) ![acceptance-test](https://github.com/int128/kubelogin/workflows/acceptance-test/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/int128/kubelogin)](https://goreportcard.com/report/github.com/int128/kubelogin) +# kubelogin [![CircleCI](https://circleci.com/gh/int128/kubelogin.svg?style=shield)](https://circleci.com/gh/int128/kubelogin) ![system-test](https://github.com/int128/kubelogin/workflows/system-test/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/int128/kubelogin)](https://goreportcard.com/report/github.com/int128/kubelogin) This is a kubectl plugin for [Kubernetes OpenID Connect (OIDC) authentication](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#openid-connect-tokens), also known as `kubectl oidc-login`. @@ -326,4 +326,4 @@ make ./kubelogin ``` -See also [the acceptance test](acceptance_test). +See also [the system test](system_test). diff --git a/docs/acceptance-test-diagram.svg b/docs/system-test-diagram.svg similarity index 100% rename from docs/acceptance-test-diagram.svg rename to docs/system-test-diagram.svg diff --git a/acceptance_test/Makefile b/system_test/Makefile similarity index 97% rename from acceptance_test/Makefile rename to system_test/Makefile index ca4d24b..092987e 100644 --- a/acceptance_test/Makefile +++ b/system_test/Makefile @@ -1,4 +1,4 @@ -CLUSTER_NAME := kubelogin-acceptance-test +CLUSTER_NAME := kubelogin-system-test OUTPUT_DIR := $(CURDIR)/output PATH := $(PATH):$(OUTPUT_DIR)/bin @@ -91,7 +91,7 @@ cluster: dex create-cluster .PHONY: create-cluster create-cluster: $(OUTPUT_DIR)/ca.crt - cp $(OUTPUT_DIR)/ca.crt /tmp/kubelogin-acceptance-test-dex-ca.crt + cp $(OUTPUT_DIR)/ca.crt /tmp/kubelogin-system-test-dex-ca.crt kind create cluster --name $(CLUSTER_NAME) --config cluster.yaml kubectl create clusterrole cluster-readonly --verb=get,watch,list --resource='*.*' kubectl create clusterrolebinding cluster-readonly --clusterrole=cluster-readonly --user=admin@example.com diff --git a/acceptance_test/README.md b/system_test/README.md similarity index 87% rename from acceptance_test/README.md rename to system_test/README.md index 2d277d2..d5325c6 100644 --- a/acceptance_test/README.md +++ b/system_test/README.md @@ -1,6 +1,6 @@ -# kubelogin/acceptance_test +# kubelogin/system_test -This is an acceptance test for walkthrough of the OIDC initial setup and plugin behavior using a real Kubernetes cluster and OpenID Connect provider, running on [GitHub Actions](https://github.com/int128/kubelogin/actions?query=workflow%3Aacceptance-test). +This is a system test for verifying the OIDC initial setup and plugin behavior using a real Kubernetes cluster and OIDC provider. It is intended to verify the following points: @@ -19,7 +19,7 @@ It performs the test using the following components: Let's take a look at the diagram. -![diagram](../docs/acceptance-test-diagram.svg) +![diagram](../docs/system-test-diagram.svg) It prepares the following resources: @@ -104,6 +104,5 @@ As a result, ### Test environment -- Set the issuer URL to kubectl. See [`kubeconfig_oidc.yaml`](kubeconfig_oidc.yaml). - Set the issuer URL to kube-apiserver. See [`cluster.yaml`](cluster.yaml). - Set `BROWSER` environment variable to run [`chromelogin`](chromelogin) by `xdg-open`. diff --git a/acceptance_test/chromelogin/main.go b/system_test/chromelogin/main.go similarity index 100% rename from acceptance_test/chromelogin/main.go rename to system_test/chromelogin/main.go diff --git a/acceptance_test/cluster.yaml b/system_test/cluster.yaml similarity index 90% rename from acceptance_test/cluster.yaml rename to system_test/cluster.yaml index d2dc8f9..bf39fde 100644 --- a/acceptance_test/cluster.yaml +++ b/system_test/cluster.yaml @@ -16,5 +16,5 @@ kubeadmConfigPatches: nodes: - role: control-plane extraMounts: - - hostPath: /tmp/kubelogin-acceptance-test-dex-ca.crt + - hostPath: /tmp/kubelogin-system-test-dex-ca.crt containerPath: /usr/local/share/ca-certificates/dex-ca.crt diff --git a/acceptance_test/dex.yaml b/system_test/dex.yaml similarity index 100% rename from acceptance_test/dex.yaml rename to system_test/dex.yaml diff --git a/acceptance_test/openssl.cnf b/system_test/openssl.cnf similarity index 100% rename from acceptance_test/openssl.cnf rename to system_test/openssl.cnf