Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ jobs:
name: Running E2E Tests
command: |
set -x
cd tests
cp ~/kc.west ~/.kube/config
cd tests
make ci-tests

generate-manifest:
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ DOCKER := docker
SKOPEO := skopeo
PODMAN := podman

# The default e2e test type is set to "ci-tests" if not provided
TEST_TYPE ?= ci-tests
TEST_OPTIONS ?= ""

Comment on lines +29 to +32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of making it simpler, by introducing just one variable, like E2E_OPTIONS ?= ci-tests ?
With that, the test-e2e target below, could be simplified into something like:

$(MAKE) -C tests/ $(E2E_OPTIONS)

And the execution could be done as:

make test-e2e
make test-e2e E2E_OPTIONS="e2e-tests"
make test-e2e E2E_OPTIONS="test TEST=hello-world"

all: skupper controller kube-adaptor network-observer

basepkg = github.com/skupperproject/skupper
Expand Down Expand Up @@ -183,3 +187,6 @@ clean:
cover.out oci-archives bundle bundle.Dockerfile \
skupper-*.tgz artifacthub-repo.yml \
network-observer-*.tgz skupper-*-scope.yaml

test-e2e:
$(MAKE) -C tests/ $(TEST_TYPE) $(TEST_OPTIONS)
36 changes: 36 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ tests/
│ ├── hello-world/ # Basic Skupper functionality test
│ ├── attached-connector/ # Network performance test with attached connectors
│ ├── redis/ # Redis test
│ ├── ha/ # High availability test
└── README.md # This file
```

Expand All @@ -36,6 +37,7 @@ The `e2e` directory contains tests that validate Skupper functionality across di
- **[hello-world](e2e/hello-world/)**: A simple test to verify basic Skupper functionality by deploying frontend and backend components across Skupper sites.
- **[attached-connector](e2e/attached-connector/)**: A test to validate Skupper connectivity using attached connectors, including network performance testing with iperf3.
- **[redis](e2e/redis/)**: A test to validate Skupper functionality with Redis, including data persistence and replication.
- **[ha](e2e/ha/)**: A test to validate Skupper high availability features, including automatic failover and recovery.

## Adding a new E2E test to be run on CI

Expand Down Expand Up @@ -94,6 +96,8 @@ make test TEST="hello-world"

2. **Available Make Commands**:

This works for the command being used INSIDE the `/tests` directory. The Makefile will automatically create a virtual environment and install all required dependencies.

```bash
# Create or refresh the virtual environment
make create-venv FORCE=true
Expand All @@ -116,6 +120,8 @@ make ci-tests

### Example summary

This works for the command being used INSIDE the `/tests` directory. The Makefile will automatically create a virtual environment and install all required dependencies.

```bash
# Create a new virtual environment
make create-venv FORCE=true
Expand All @@ -133,6 +139,36 @@ make test-subset TESTS=hello-world,attached-connector
make ci-tests
```

## Running Tests from the ROOT of the Repository

The root of the repository contains a main Makefile that abstracts and simplifies the process of running tests. This Makefile acts as a wrapper, delegating specific commands to the Makefile located in the `tests` directory. By using the main Makefile, you can execute test-related commands from the root of the repository without needing to navigate into the `tests` directory manually. It ensures that all necessary dependencies and configurations are properly handled before invoking the corresponding commands in the `tests` Makefile.

### Variables explained

- **TEST_TYPE**: The type of test to run (e.g., `ci-tests`, `e2e-tests`, `test-subset`, `test`).
- **TEST_OPTIONS**: Additional options to pass to the test command (e.g., `TEST=hello-world`) or `TESTS=hello-world,attached-connector`).
- **FORCE**: Force the creation of a new virtual environment, even if one already exists.

### Available Commands

For example:

```bash
# Run the ci-tests subset from the root
make tests-e2e ci-tests

# Run all E2E tests from the root
make tests-e2e e2e-tests
Comment on lines +158 to +161
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be: test-e2e, instead?


# Run a specific test from the root
make test-e2e TEST_TYPE=test TEST_OPTIONS="TEST=hello-world"

# Run a specific test with a subset of tests from the root
make test-e2e TEST_TYPE=test-subset TEST_OPTIONS="TESTS=hello-world,attached-connector"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for my first comment is that it feels too complex to run samples like this one...

```

This abstraction ensures a consistent and streamlined workflow for running tests across the repository.

## Core Ansible Collections

The tests rely on the following Ansible collections:
Expand Down