e2e

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

README

Forwarder e2e tests

Running the e2e tests with the test runner

  1. Build the forwarder image make -C ../ update-devel-image
  2. Start the test runner make run-e2e
  3. The test runner will run all the tests sequentially and output the results to the console
  4. If one of the test fails, the procedure will stop, test output will be printed
  5. Environment will not be pruned once the error occurred, remember to manually clean it up with make down or use the containers to run single test and find bugs

Debugging / Manually running the e2e tests

  1. Build the forwarder image make -C ../ update-devel-image
  2. Provide docker-compose.yaml or use the one created by the test runner
  3. Start the environment with make up
  4. Run specific test with RUN=<test> make test
  5. Dump containers logs if needed make dump-logs
  6. Stop the environment with make down

Once the test is complete you may also run curl from the proxy container ex. docker-compose exec proxy curl -vvv --insecure --proxy-insecure --proxy https://localhost:3128 https://httpbin:8080/status/200

You can kill one of the containers with make term ex. SRV=forwarder-e2e-httpbin-1 make term to kill the httpbin container and see how the proxy behaves

If one wants to use different forwarder image use FORWARDER_VERSION env variable ex. FORWARDER_VERSION=1.0.0 make <target>

Benchmarking

  1. Add benchmark to bench_test.go or use an existing one
  2. Run the make bench function ex. RUN=BenchmarkRespBody1k make bench it will output the profile path directly to the console
  3. Run pprof with the profile output ex. go tool pprof -http=:8080 /path/to/profiles/cpu

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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