g3/scripts/coverage/g3bench
Zhang Jingqiang 81309d17fb
Some checks are pending
CodeCoverage / lib unit test (push) Waiting to run
CodeCoverage / g3mkcert test (push) Waiting to run
CodeCoverage / g3keymess test (push) Waiting to run
CodeCoverage / g3proxy test (push) Waiting to run
CodeCoverage / g3bench test (push) Waiting to run
CodeCoverage / g3statsd test (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (java-kotlin) (push) Waiting to run
CodeQL Advanced / Analyze (python) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
CrossCompiling / Build (push) Waiting to run
Linux-CI / Build (push) Waiting to run
Linux-CI / Clippy (push) Waiting to run
Linux-CI / Build vendored (push) Waiting to run
Linux-CI / Build with OpenSSL Async Job (push) Waiting to run
MacOS-CI / Build vendored (push) Waiting to run
StaticLinking / musl (push) Waiting to run
StaticLinking / msvc (push) Waiting to run
Windows-CI / Build (push) Waiting to run
Windows-CI / Build vendored (push) Waiting to run
MacOS-CI / Build (push) Waiting to run
g3bench: allow more flexible rate limit config
2025-07-31 18:33:18 +08:00
..
.gitignore add CI test for g3bench 2024-12-05 14:22:28 +08:00
dnsmasq.conf add CI test for g3bench 2024-12-05 14:22:28 +08:00
g3proxy.yaml add CI test for g3bench 2024-12-05 14:22:28 +08:00
g3statsd.yaml g3statsd: enable worker in CI 2025-05-13 00:05:22 +08:00
mkcert.sh g3bench: allow to verify all keyless result 2025-02-21 19:27:16 +08:00
nginx.conf add CI test for g3bench 2024-12-05 14:22:28 +08:00
README.md update coverage README 2025-05-09 10:17:05 +08:00
run.sh g3bench: add test for thrift ttheader transport and binary protocol 2025-07-20 17:27:38 +08:00
target_dns.sh add CI test for g3bench 2024-12-05 14:22:28 +08:00
target_h1.sh g3bench: allow to set header for h1/h2/h3 2025-06-29 08:37:11 +08:00
target_h2.sh g3bench: allow to set header for h1/h2/h3 2025-06-29 08:37:11 +08:00
target_keyless_openssl.sh g3bench: allow more flexible rate limit config 2025-07-31 18:33:18 +08:00
target_openssl.sh coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
target_rustls.sh coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
target_thrift_tcp.sh g3bench: fix thrift kitex ttheader acl token 2025-07-23 11:31:13 +08:00

Setup for g3bench coverage tests

Install Required Tools

We use the following tools in the coverage scripts:

docker

We use docker containers to run various target services, i.e. httpbin.

Install on Debian:

apt install docker.io

dnsmasq

We use dnsmasq to add local dns records, and also use it as the target dns server.

You have 2 choices to run dnsmasq:

  • NetworkManager Plugin

    If you have enabled dnsmasq plugin in NetworkManager, then there is nothing to do. The conf directory will be /etc/NetworkManager/dnsmasq.d/.

  • Standalone dnsmasq Service

    If not, you have to install dnsmasq as a standalone service. The conf directory will be /etc/dnsmasq.d/.

    Install on Debian:

    apt install dnsmasq
    

Setup local DNS

Save the following conf file to dnsmasq.d/g3proxy-ci.conf:

address=/httpbin.local/127.0.0.1
address=/g3proxy.local/127.0.0.1

Then restart NetworkManager or dnsmasq which should respawn the real dnsmasq process.

Run the Docker Containers

httpbin

docker run -p 127.0.0.1:80:80 -d --name httpbin kennethreitz/httpbin

influxdb

  1. Run the container

    docker pull influxdb:3-core
    docker run -p 127.0.0.1:8181:8181 --rm influxdb:3-core --node-id local --object-store=memory
    
  2. Create the auth token

    curl -X POST http://127.0.0.1:8181/api/v3/configure/token/admin | jq ".token" -r
    
  3. Export the auth token as variable INFLUXDB3_AUTH_TOKEN.

graphite

docker pull graphiteapp/graphite-statsd:latest
docker run -p 127.0.0.1:2003:2003 --rm graphiteapp/graphite-statsd