mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-05-07 18:09:36 +00:00
* ci(docker): build dist-tests images * Update to .net 10, kubernetes client 18.0.13 Kubernetes client 18.0.13 is compatible with Kubernetes 1.34.x. The Kubernetes version is selected automatically by kubeadm in docker desktop (v1.34.1). See https://github.com/kubernetes-client/csharp#version-compatibility for a compatibility table. * Updates to support Kubernetes upgrade * bump openapi.yaml to match openapi.yaml in the logos-storage-nim docker image * bump doc to .net 10 * bump docker to .net 10 * Build image with latest tag always Always build an image with a latest tag (as well as a sha commit hash) when there's a push to master * docker image tag as "latest" only when pushing to master * Update docker image to install doctl * Remove doctl install kubeconfig is now created and uses a plain bearer token instead of using doctl as a credential mgr * Rename and remove all instances of Codex * Further remove CodexNetDeployer as it is no longer needed --------- Co-authored-by: Adam Uhlíř <adam@uhlir.dev>
3.4 KiB
3.4 KiB
Distributed System Tests for Logos Storage
Contributing tests
Do you want to write some tests using this distributed test setup? Great! Here's what you do.
- Create a branch. Name it something descriptive, but start it with
tests/please. [Example:tests/data-redundancy.] - Checkout your branch.
- Create a new assembly in the
/Testsfolder. This can be an NUnit test assembly or simply a console app. - Add Project references to
Core, as well as any project plugin you'll be using. - Write tests! Use existing tests for inspiration.
Tips for writing tests for Logos Storage
Transient tests
- Add new code files to
Tests/LogosStorageTests - Inherrit from
LogosStorageDistTestorAutoBootstrapDistTest. - When using
LogosStorageDistTest:- You must start your own Codex bootstrap node. You can use
AddLogosStorage(...)for this. - When you start other Logos Storage nodes with
AddLogosStorage(...)you can pass the bootstrap node by adding the.WithBootstrapNode(...)option.
- You must start your own Codex bootstrap node. You can use
- When using
AutoBootstrapDistTest:- The test-infra creates the bootstrap node for you, and automatically passes it to each Logos Storage node you create in your tests. Handy for keeping your tests clean and to-the-point.
- When using the auto-bootstrap, you have no control over the bootstrap node from your tests. You can't (for example) shut it down during the course of the test. If you need this level of control for your scenario, use the
LogosStorageDistTestinstead.
- If your test needs a long time to run, add the
[UseLongTimeouts]function attribute. This will greatly increase maximum time-out values for operations like for example uploading and downloading files.
Continuous tests
- Add new code files to
Tests/LogosStorageContinuousTests/Tests - Inherrit from
ContinuousTest - Define one or more methods and decorate them with the
[TestMoment(...)]attribute. - The TestMoment takes a number of seconds as argument. Each moment will be executed by the continuous test runner applying the given seconds as delay. (Non-cumulative. So two moments at T:10 will be executed one after another without delay, in this case the order of execution should not be depended upon.)
- Continuous tests automatically receive access to the Logos Storage nodes that the tests are being run against.
- Additionally, Continuous tests can start their own transient Logos Storage nodes and bootstrap them against the persistent nodes.
Tips for either type of test
- You can generate files of random test data by calling
GenerateTestFile(...). - You can enable access to the Logos Storage node metrics by adding the option
.EnableMetrics(). Enabling metrics will make the test-infra download and save all Logos Storage metrics in case of a test failure. (The metrics are stored as CSV, in the same location as the test log file.) - You can enable access to the blockchain marketplace by adding the option
.EnableMarketplace(...). - Enabling metrics and/or enabling the marketplace takes extra resources from the test-infra and increases the time needed during Logos Storage node setup. Please don't enable these features unless your tests need them.
- Tip: Logos Storage nodes can be named. Use the option
WithName(...)and make reading your test logs a little nicer! - Tip: Commit often.
Don't forget
- Once you're happy with your tests, please create a pull-request and ask a Logos Storage core contributor to review your changes.