Skip to content

Commit

Permalink
Merge pull request #119 from PierreBeucher/test-update
Browse files Browse the repository at this point in the history
Test update
  • Loading branch information
PierreBeucher authored May 27, 2024
2 parents 71b42b5 + 41704ae commit 9f4ec06
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 29 deletions.
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ build-nix:
nix build -o build/nix

.PHONY: test
test: test-docker test-doc test-clippy test-cargo test-cli test-install

.PHONY: test-docker
test-docker:
podman-compose -f tests/docker-compose.yml up -d
kind delete cluster -n novops-auth-test
kind create cluster -n novops-auth-test
docker network connect tests_default novops-auth-test-control-plane
test: test-prepare test-doc test-clippy test-cargo test-cli test-install test-teardown

.PHONY: test-prepare
test-prepare:
tests/scripts/test-docker-prepare.sh

.PHONY: test-teardown
test-teardown:
tests/scripts/test-docker-teardown.sh

.PHONY: test-cargo
test-cargo:
Expand Down
54 changes: 33 additions & 21 deletions docs/schema/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,20 @@
{
"type": "object",
"required": [
"mount_path",
"role",
"type"
],
"properties": {
"mount_path": {
"type": "string"
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
Expand All @@ -425,16 +429,20 @@
{
"type": "object",
"required": [
"mount_path",
"role_id",
"type"
],
"properties": {
"mount_path": {
"type": "string"
"type": [
"string",
"null"
]
},
"role_id": {
"type": "string"
"type": [
"string",
"null"
]
},
"secret_id_path": {
"type": [
Expand All @@ -453,16 +461,20 @@
{
"type": "object",
"required": [
"mount_path",
"role",
"type"
],
"properties": {
"mount_path": {
"type": "string"
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
"type": [
"string",
"null"
]
},
"token_path": {
"type": [
Expand Down Expand Up @@ -580,15 +592,6 @@
"null"
]
},
"timeout": {
"description": "Vault client timeout in seconds. Default to 60s.",
"type": [
"integer",
"null"
],
"format": "uint64",
"minimum": 0.0
},
"auth": {
"description": "Vault authentication to use when a token is not provided",
"anyOf": [
Expand All @@ -600,6 +603,15 @@
}
]
},
"timeout": {
"description": "Vault client timeout in seconds. Default to 60s.",
"type": [
"integer",
"null"
],
"format": "uint64",
"minimum": 0.0
},
"token": {
"description": "Vault token as plain string\n\nUse for testing only. DO NOT COMMIT NOVOPS CONFIG WITH THIS SET.",
"type": [
Expand Down
16 changes: 16 additions & 0 deletions tests/scripts/test-docker-prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -e

CONTAINER_CLI=${CONTAINER_CLI:-docker}

export KIND_EXPERIMENTAL_PROVIDER=$CONTAINER_CLI

$CONTAINER_CLI compose -f tests/docker-compose.yml up -d

if ! kind get clusters | grep -q 'novops-auth-test'; then
kind create cluster -n novops-auth-test
$CONTAINER_CLI network connect tests_default novops-auth-test-control-plane
else
echo "Kind cluster already exists"
fi
11 changes: 11 additions & 0 deletions tests/scripts/test-docker-teardown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -e

CONTAINER_CLI=${CONTAINER_CLI:-docker}


export KIND_EXPERIMENTAL_PROVIDER=$CONTAINER_CLI
kind delete cluster -n novops-auth-test

$CONTAINER_CLI compose -f tests/docker-compose.yml down -v

0 comments on commit 9f4ec06

Please sign in to comment.