From e75129397af7a8d8fd2374d5f197aaf67aca52c7 Mon Sep 17 00:00:00 2001 From: darindibello Date: Sun, 28 Apr 2024 17:23:08 +0000 Subject: [PATCH 1/2] adding unit testing in pipeline.yaml --- .tekton/pipeline.yaml | 19 +++++++++++++++++++ Agent | 0 2 files changed, 19 insertions(+) create mode 100644 Agent diff --git a/.tekton/pipeline.yaml b/.tekton/pipeline.yaml index 929e2b2..94e3662 100644 --- a/.tekton/pipeline.yaml +++ b/.tekton/pipeline.yaml @@ -72,5 +72,24 @@ spec: workspaces: - name: source workspace: pipeline-workspace + - name: testing + params: + - name: PYTEST_ARGS + value: + - '--pspec' + - '--cov=service' + - '--cov-fail-under=95' + - name: SECRET_NAME + value: postgres-creds + - name: SECRET_KEY + value: database_uri + runAfter: + - git-clone + taskRef: + kind: Task + name: pytest-env + workspaces: + - name: source + workspace: pipeline-workspace workspaces: - name: pipeline-workspace diff --git a/Agent b/Agent new file mode 100644 index 0000000..e69de29 From bb186647d13070feabb3191efb857d54ecdbf06e Mon Sep 17 00:00:00 2001 From: Amanda Aulia Date: Mon, 29 Apr 2024 00:10:18 +0000 Subject: [PATCH 2/2] Fix secret issue --- k8s/postgresql.yaml | 5 ++--- k8s/secret.yaml | 17 ----------------- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 k8s/secret.yaml diff --git a/k8s/postgresql.yaml b/k8s/postgresql.yaml index 090d3c7..bb65f86 100644 --- a/k8s/postgresql.yaml +++ b/k8s/postgresql.yaml @@ -98,6 +98,5 @@ metadata: name: postgres-creds data: password: cGdzM2NyM3Q= - database_uri: | - cG9zdGdyZXNxbCtwc3ljb3BnOi8vcG9zdGdyZXM6cGdzM2NyM3RAcG9zdGdyZXM6NTQzMi9wZXRz - dG9yZQ== \ No newline at end of file + database_uri: + cG9zdGdyZXNxbCtwc3ljb3BnOi8vcG9zdGdyZXM6cGdzM2NyM3RAcG9zdGdyZXM6NTQzMi9wcm9tb3Rpb25z \ No newline at end of file diff --git a/k8s/secret.yaml b/k8s/secret.yaml deleted file mode 100644 index 77edf9c..0000000 --- a/k8s/secret.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -# This secret can also be created from the command line using environment variables -# -# export DATABASE_URI='postgresql+psycopg://:@:/' -# export POSTGRES_PASSWORD='' -# -# kubectl create secret generic postgres-creds \ -# --from-literal=password=$POSTGRES_PASSWORD -# --from-literal=database_uri=$DATABASE_URI -# -apiVersion: v1 -kind: Secret -metadata: - name: postgres-creds -data: - password: cG9zdGdyZXM= - database_uri: cG9zdGdyZXNxbCtwc3ljb3BnOi8vcG9zdGdyZXM6cG9zdGdyZXNAcG9zdGdyZXM6NTQzMi9wb3N0Z3Jlcw==