Skip to content

Commit

Permalink
Run e2e test with fingerproxy, not echo server.
Browse files Browse the repository at this point in the history
  • Loading branch information
wi1dcard committed Mar 17, 2024
1 parent 3504cc0 commit a3cd1f2
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
name: fingerproxy_linux_amd64_${{ steps.short-sha.outputs.value }}
path: bin/fingerproxy_linux_amd64

build-echoserver:
name: Build echo server
build-test-deps:
name: Build test deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -67,55 +67,60 @@ jobs:
go version
go get
go build -tags debug ./example/echo-server
go build -tags debug -o fingerproxy ./cmd
./testdata/gencert.sh
- uses: actions/upload-artifact@v4
with:
name: echoserver-ci-only
name: ci-test-deps
path: |
echo-server
fingerproxy
tls.crt
tls.key
e2e-test:
name: E2E test
runs-on: ubuntu-latest
needs: build-echoserver
needs: build-test-deps
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: echoserver-ci-only
name: ci-test-deps
- name: Setup curl
run: |
wget https://github.com/stunnel/static-curl/releases/download/8.6.0-1/curl-linux-x86_64-8.6.0.tar.xz
tar xf curl-linux-x86_64-8.6.0.tar.xz
./curl --version
- name: Test
run: |
chmod +x ./echo-server
./echo-server -verbose &
chmod +x ./fingerproxy
./fingerproxy -verbose \
-listen-addr localhost:8443 \
-forward-url https://httpbin.org &
sleep 1
./curl -v --fail --insecure -o o.json https://localhost:8443/json
./curl -v --fail --insecure -o o.json "https://localhost:8443/anything?show_env=1"
cat o.json | jq
test $(jq -r '.http2' o.json) = "3:100;4:10485760;2:0|1048510465|0|m,s,a,p"
test $(jq -r '.ja3' o.json) = "0149f47eabf9a20d0893e2a44e5a6323"
test $(jq -r '.ja4' o.json) = "t13d3112h2_e8f1e7e78f70_6bebaf5329ac"
test $(jq -r '."user-agent"' o.json) = "curl/8.6.0"
test $(jq -r '.headers."X-Http2-Fingerprint"' o.json) = "3:100;4:10485760;2:0|1048510465|0|m,s,a,p"
test $(jq -r '.headers."X-Ja3-Fingerprint"' o.json) = "0149f47eabf9a20d0893e2a44e5a6323"
test $(jq -r '.headers."X-Ja4-Fingerprint"' o.json) = "t13d3112h2_e8f1e7e78f70_6bebaf5329ac"
test $(jq -r '.headers."User-Agent"' o.json) = "curl/8.6.0"
load-test:
name: Load test
runs-on: ubuntu-latest
needs: build-echoserver
needs: build-test-deps
strategy:
matrix:
number_of_requests: [1000, 10000, 50000]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: echoserver-ci-only
name: ci-test-deps
- name: Setup ab
run: |
sudo apt-get install -y apache2-utils
Expand All @@ -135,12 +140,12 @@ jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
needs: build-echoserver
needs: build-test-deps
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: echoserver-ci-only
name: ci-test-deps
- name: Setup wrk
run: |
sudo apt-get install -y wrk
Expand Down

0 comments on commit a3cd1f2

Please sign in to comment.