Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel e2e tests #765

Merged
merged 18 commits into from
Apr 4, 2024
Merged

Parallel e2e tests #765

merged 18 commits into from
Apr 4, 2024

Conversation

mmatczuk
Copy link
Contributor

@mmatczuk mmatczuk commented Apr 4, 2024

This patchset redefines our e2e tests framework allowing to run the tests in parallel.
It also allows to run remotely with podman-remote as the container runtime.

Check e2e/README.md for details.

@mmatczuk mmatczuk requested a review from Choraden as a code owner April 4, 2024 11:11
@mmatczuk mmatczuk mentioned this pull request Apr 4, 2024
}

setups := slices.Clone(r.Setups)
if r.Parallel != 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: r.Parallel != 1 && !r.Debug

@Choraden
Copy link
Contributor

Choraden commented Apr 4, 2024

LGTM, the debug mode satisfies my needs.

I'm a little surprised the e2e job takes 5m. I thought we would be able to reduce it even more, but it is still a great improvement as non parallel takes 8m on average.

@mmatczuk
Copy link
Contributor Author

mmatczuk commented Apr 4, 2024

Adding more parallelism does not make it run faster due to constrained resources.
We could run it in two shards odd and even to make it twice as fast.

@mmatczuk
Copy link
Contributor Author

mmatczuk commented Apr 4, 2024

#770

mmatczuk added 18 commits April 4, 2024 16:00
This enabled building in rootful podman.
Otherwise we hit this error

Error: building at STEP "RUN apk add --no-cache bash bash-completion ca-certificates curl jq": setup network: pasta failed with exit code 1:
Don't run as root. Changing to nobody...
No routable interface for IPv6: IPv6 is disabled
Couldn't open network namespace /proc/171325/ns/net: Permission denied
Apply single responsibility principle and make Compose a data type.
The command helper is moved to separate type.
Modernize code and prepare for expanding to other commands in the future.
The standard --wait flag does not work with podman compose and work on all services in the compose file.
This implementation works only on the started containers.
Volumes are problematic when running on remote machines - don't use them.
Ports are now accessible via test container.
The mapped ports cause problems when containers are not properly cleaned.
New runner implementation based on updated Compose utility.
Tests must run in a container "test" that needs to be part of each setup.

Debug mode preserves compatibility with the previous version.
Only single setup running in parallel and compose file is accessible locally.

To speed things up compose teardown is executed asynchronously.
In CI we do not wait for teardown completion.
Refactor dns and sc-2450 to separate containers.
This allows to have healthcheck on them that simplifies the waiting.
The .env file is not read by podman-compose.
Also, when running with tmp files it's not practical.
Move everything to envvars.
Automatically print compose file and logs on test failure

$ make run-e2e
=== setup defaults-http-http
services:
    httpbin:
        image: saucelabs/forwarder:${FORWARDER_VERSION}
        command: test httpbin
        environment:
            FORWARDER_API_ADDRESS: :10000
            FORWARDER_PROTOCOL: http
        ports:
            - 10002:10000
    proxy:
        image: saucelabs/forwarder:${FORWARDER_VERSION}
        environment:
            FORWARDER_API_ADDRESS: :10000
            FORWARDER_PROTOCOL: http
        ports:
            - 3128:3128
            - 10000:10000

>>>> Executing external compose provider "/opt/homebrew/bin/docker-compose". Please refer to the documentation for details. <<<<

httpbin-1  | 2024/03/28 14:00:23.703134 [INFO] configuration
httpbin-1  | api-address=:10000
httpbin-1  | protocol=http
httpbin-1  | 2024/03/28 14:00:23.703319 [server] [INFO] HTTP server listen address=[::]:8080 protocol=http
httpbin-1  | 2024/03/28 14:00:23.703354 [api] [INFO] HTTP server listen address=[::]:10000 protocol=http
proxy-1    | 2024/03/28 14:00:23.661974 [INFO] Forwarder Unknown (Unknown)
proxy-1    | 2024/03/28 14:00:23.661986 [INFO] configuration
proxy-1    | api-address=:10000
proxy-1    | protocol=http
proxy-1    | 2024/03/28 14:00:23.662682 [proxy] [INFO] no upstream proxy specified
proxy-1    | 2024/03/28 14:00:23.662722 [proxy] [INFO] localhost proxying mode=deny
proxy-1    | 2024/03/28 14:00:23.662990 [proxy] [INFO] PROXY server listen address=[::]:3128 protocol=http
proxy-1    | 2024/03/28 14:00:23.663153 [api] [INFO] HTTP server listen address=[::]:10000 protocol=http
exit status 2
exit status 1
make: *** [Makefile:13: run-e2e] Error 1
Rename additional network to internal.
If there is a network defined automatically add test container to it.
Run all test with a single command.
@mmatczuk mmatczuk merged commit 78781a9 into main Apr 4, 2024
6 checks passed
@mmatczuk mmatczuk deleted the mmt/parallel_e2e branch April 4, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants