tests/

directory
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0

README

Eden Integration Tests

This directory contains a series of integration tests that meet the eden task API, and thus can be launched using eden test. Each subdirectory contains an individual test suite with one or more tests.

The general principles for integration testing of EVE are available at EVE+Integration+Testing

The testing workflow for CI/CD of this eden project is at workflow/README.MD

Running Integration Tests

You can run either the entire suite of tests in this repository, or an individual test or suite.

Running The Entire Test Suite

To run the entire suite of integration tests, run either:

  • make test in the root of this repository
  • make test in this tests/ directory
Running Individual Tests

To run any single suite of integration tests, launch them like any other eden test/task:

eden test tests/testdir/

You also can run make test in any individual test suite directory.

If you want to run one specific test, run:

eden test tests/testdir/ -t <TestName>

See the documentation for running eden tests for more options.

Building Integration Tests

The integration tests under tests/ ship as source code. If you want to run them, you will need to build them. You can do this in one of several ways:

  • To build an individual test, in its directory, run make build
  • To build all tests, in this directory tests/, run make build
  • To build all tests, in the root directory of the eden repository, run one of:
    • make build-tests - builds eden and all integration tests
    • make testbin - builds all integration tests

Writing Integration Tests

Test Suite Structure

Each test suite, in its own directory, must implement the eden task API, and thus contains, at least:

  • the configuration file eden-config.yml with the corresponding fields
    • eden.test-bin - references the name of the binary built by make build
      • eden.test-script - references the test script in the test directory
  • a test script

In addition, each directory, in order to be part of the integration test suite, contains a Makefile with at least the following targets:

  • build - build the test binary, if any, and places it in a directed bindir
  • setup - sets up the test environment
  • clean - removes any artifacts
  • test - executes the built test binary

The above targets must exist; if any is unneeded, it should be an empty target.

The bindir is expected to be $(WORKDIR)/bin/. For example, if the test binary is to be named footest, then the following should be the behaviour:

  • make build WORKDIR=/tmp -> /tmp/bin/footest
  • make build WORKDIR=/usr/local -> /usr/local/bin/footest
  • make build -> whatever the Makefile uses as its default

These Makefile are not requirements for the general eden task API,but rather to be part of the standard set of integration tests that are launched by this repository.

Test Suite Language

The tests in this directory are implemented in Golang. They meet the Golang testing standard by naming all test files _test.go, and thus can be compiled via go test -c. The compiled standalone binaries and individual tests/subtests from them can be combined in test scripts with the ability to configure runtime parameters and a specific EDEN configuration environment. In test scenarios and configuration files may be used standard Go templates machinery with some EDEN-specific extensions.

However, it is not required that a test be built in go. Future tests in this directory may use different languages, provided that they meet the eden task API and the Makefile structure.

Directories

Path Synopsis
escript
go-internal/internal/syscall/windows/sysdll
Package sysdll is an internal leaf package that records and reports which Windows DLL names are used by Go itself.
Package sysdll is an internal leaf package that records and reports which Windows DLL names are used by Go itself.
go-internal/internal/textutil
Package textutil contains text processing utilities.
Package textutil contains text processing utilities.
go-internal/par
Package par implements parallel execution helpers.
Package par implements parallel execution helpers.
go-internal/testenv
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
go-internal/testscript
Package testscript provides support for defining filesystem-based tests by creating scripts in a directory.
Package testscript provides support for defining filesystem-based tests by creating scripts in a directory.
go-internal/txtar
Package txtar implements a trivial text-based file archive format.
Package txtar implements a trivial text-based file archive format.
io_performance

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳