Distributed System Tests for Nim-Codex
Go to file
benbierens df8ab6bcf5
Serialization gate requirement passed.
2023-09-20 10:13:29 +02:00
.github/workflows Fix Dist-Tests workflow inputs (#54) 2023-09-06 19:29:37 +03:00
ArgsUniform support for bool in argsuniform 2023-06-30 09:14:54 +02:00
CodexContractsPlugin Serialization gate requirement passed. 2023-09-20 10:13:29 +02:00
CodexNetDeployer Fixes missing usings 2023-09-08 10:21:40 +02:00
CodexNetDownloader automatically determine runner location 2023-08-11 08:39:51 +02:00
CodexPlugin Serialization gate requirement passed. 2023-09-20 10:13:29 +02:00
ContinuousTests simple test lined up 2023-09-12 10:31:55 +02:00
Core Serialization gate requirement passed. 2023-09-20 10:13:29 +02:00
DistTestCore Can send eth 2023-09-19 11:51:59 +02:00
FileUtils initialize plugins with constructor 2023-09-13 10:03:11 +02:00
GethPlugin Serialization gate requirement passed. 2023-09-20 10:13:29 +02:00
KubernetesWorkflow Serialization gate requirement passed. 2023-09-20 10:13:29 +02:00
Logging wiring up metadata 2023-09-13 16:06:05 +02:00
LongTests Extracts file manager utils to separate assembly 2023-09-11 10:43:27 +02:00
MetricsPlugin Serialization gate requirement passed. 2023-09-20 10:13:29 +02:00
Nethereum Cleanup 2023-09-19 13:58:45 +02:00
Tests Sets serialization gate between each deploy and wrap to ensure application lifecycle invariance. 2023-09-20 09:16:57 +02:00
Utils Moves ByteSize to Utils assembly. 2023-09-08 09:39:56 +02:00
docker Add documentation how to run tests in remote Kubernetes (#41) 2023-08-17 14:43:13 +03:00
docs Add documentation how to run tests in remote Kubernetes (#41) 2023-08-17 14:43:13 +03:00
.gitignore ADD Parallel download Tests 2023-04-19 12:34:46 +02:00
CONTRIBUTINGTESTS.MD Setup and contributing instructions 2023-05-01 16:26:26 +02:00
README.md Add documentation how to run tests in remote Kubernetes (#41) 2023-08-17 14:43:13 +03:00
codexnode-manifest.yml Use codexstorage/nim-codex Docker images 2023-05-30 22:45:41 +03:00
cs-codex-dist-testing.sln deploys codex contract 2023-09-15 16:27:08 +02:00

README.md

Distributed System Tests for Nim-Codex

Using a common dotnet unit-test framework and a few other libraries, this project allows you to write tests that use multiple Codex node instances in various configurations to test the distributed system in a controlled, reproducible environment.

Nim-Codex: https://github.com/codex-storage/nim-codex
Dotnet: v6.0
Kubernetes: v1.25.4
Dotnet-kubernetes SDK: v10.1.4 https://github.com/kubernetes-client/csharp
Nethereum: v4.14.0

Tests

Tests are devided into two assemblies: /Tests and /LongTests. /Tests is to be used for tests that take several minutes to hours to execute. /LongTests is to be used for tests that take hours to days to execute.

TODO: All tests will eventually be running as part of a dedicated CI pipeline and kubernetes cluster. Currently, we're developing these tests and the infra-code to support it by running the whole thing locally.

Configuration

Test executing can be configured using the following environment variables.

Variable Description Default
KUBECONFIG Optional path (abs or rel) to kubeconfig YAML file. When null, uses system default (docker-desktop) kubeconfig if available. (null)
LOGPATH Path (abs or rel) where log files will be saved. "CodexTestLogs"
LOGDEBUG When "true", enables additional test-runner debug log output. "false"
DATAFILEPATH Path (abs or rel) where temporary test data files will be saved. "TestDataFiles"
LOGLEVEL Codex log-level. (case-insensitive) "Trace"
RUNNERLOCATION Use "ExternalToCluster" when test app is running outside of the k8s cluster. Use "InternalToCluster" when tests are run from inside a pod/container. "ExternalToCluster"

Test logs

Because tests potentially take a long time to run, logging is in place to help you investigate failures afterwards. Should a test fail, all Codex terminal output (as well as metrics if they have been enabled) will be downloaded and stored along with a detailed, step-by-step log of the test. If something's gone wrong and you're here to discover the details, head for the logs.

How to contribute tests

An important goal of the test infra is to provide a simple, accessible way for developers to write their tests. If you want to contribute tests for Codex, please follow the steps HERE.

Run the tests on your machine

Creating tests is much easier when you can debug them on your local system. This is possible, but requires some set-up. If you want to be able to run the tests on your local system, follow the steps HERE. Please note that tests which require explicit node locations cannot be executed locally. (Well, you could comment out the location statements and then it would probably work. But that might impact the validity/usefulness of the test.)

Missing functionality

Surely the test-infra doesn't do everything we'll need it to do. If you're running into a limitation and would like to request a new feature for the test-infra, please create an issue.