tests

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

Oasis Nexus Tests

This directory contains tests for Oasis Nexus. They have been organized as follows:

  • e2e/ contains tests that run against a fake blockchain (provided by oasis-net-runner) and a black-box Nexus (i.e. only external APIs are accessed).
  • genesis/ contains tests that validate our database state is correct against oasis-node genesis state.
  • http/ contains tests that validate API endpoints behave as expected and return correct output.

E2E Tests

To ensure that tests behave as expected on CI, you should have Docker environment configured as per the top-level README.

Running e2e tests locally

For the canonical way to run these tests, see the CI config. Here are some useful one-liners derived from those commands, and adapted for running locally and repeatedly.

Build docker containers with current code
make docker
Run the e2e tests

This line will clean up any prior runs and start a new run of tests inside the nexus container:

make stop-e2e && make start-e2e

make stop-e2e wipes the state for oasis-net-runner; state left over from previous runs prevents the runner from starting. (Error: failed to provision entity: oasis/entity: failed to create deterministic identity: signature/signer/file: key already exists)

Check Nexus logs
docker logs nexus --since 2m -t | less

This is the dockerized nexus against which the e2e tests ran.

Documentation

Index

Constants

View Source
const (
	GenesisHeight = int64(8_048_956) // TODO: Get from config.
)

Variables

This section is empty.

Functions

func After

func After(height int64) <-chan int64

After waits for the height to be indexed and then sends the indexed height on the returned channel.

func GetFrom

func GetFrom(path string, v interface{}) error

GetFrom completes an HTTP request and returns the unmarshalled response.

func Init

func Init()

Init initializes the testing environment.

func SkipIfShort

func SkipIfShort(t *testing.T)

Skip test in short test mode.

func SkipUnlessE2E

func SkipUnlessE2E(t *testing.T)

Separate running of e2e tests.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL