cs-codex-dist-tests/docker/README.md

1.5 KiB

Run tests with Docker in Kubernetes

We may run tests localy using installed Dotnet and inside Kubernetes we may use a prepared Docker images.

Custom entrypoint will do the following

  1. Clone repository
  2. Switch to the specific branch - master by default
  3. Run all tests - dotnet test

Run with defaults

docker run \
  --rm \
  --name cs-codex-dist-tests \
  codexstorage/cs-codex-dist-tests:sha-686757e

Just short tests

docker run \
  --rm \
  --name cs-codex-dist-tests \
  codexstorage/cs-codex-dist-tests:sha-686757e \
  dotnet test Tests

Custom branch

docker run \
  --rm \
  --name cs-codex-dist-tests \
  --env BRANCH=feature/tests \
  codexstorage/cs-codex-dist-tests:sha-686757e

Custom local config

docker run \
  --rm \
  --name cs-codex-dist-tests \
  --env CONFIG=/opt/Configuration.cs \
  --env CONFIG_SHOW=true \
  --volume $PWD/DistTestCore/Configuration.cs:/opt/Configuration.cs \
  codexstorage/cs-codex-dist-tests:sha-686757e

Local kubeconfig with custom local config

docker run \
  --rm \
  --name cs-codex-dist-tests \
  --env CONFIG=/opt/Configuration.cs \
  --env CONFIG_SHOW=true \
  --env SOURCE=https://github.com/codex-storage/cs-codex-dist-tests.git \
  --volume $PWD/DistTestCore/Configuration.cs:/opt/Configuration.cs \
  --volume $PWD/kubeconfig.yml:/opt/kubeconfig.yml \
  codexstorage/cs-codex-dist-tests:sha-686757e