From 0a2d75c60910fdabffbef15fd806c26f6f94e88d Mon Sep 17 00:00:00 2001 From: Peter Lee Date: Wed, 17 Jul 2024 16:22:10 -0700 Subject: [PATCH] do env var replacement for cloudflare only --- .github/actions/performance-tests/art.yaml | 2 +- .../ci-nightly-performance-testing.yaml | 41 ++----------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/.github/actions/performance-tests/art.yaml b/.github/actions/performance-tests/art.yaml index 598d773c68..82aa5a404b 100644 --- a/.github/actions/performance-tests/art.yaml +++ b/.github/actions/performance-tests/art.yaml @@ -16,7 +16,7 @@ config: threshold: 1 publish-metrics: - type: prometheus - pushgateway: 'https://pushgateway-testnet.rpc.zetachain.com/${CLOUDFLARE_UUID}' + pushgateway: 'https://pushgateway-testnet.rpc.zetachain.com/-=CLOUDFLARE_UUID=-' tags: - 'type:loadtest' summary: true diff --git a/.github/workflows/ci-nightly-performance-testing.yaml b/.github/workflows/ci-nightly-performance-testing.yaml index f5db737962..b1a493fab1 100644 --- a/.github/workflows/ci-nightly-performance-testing.yaml +++ b/.github/workflows/ci-nightly-performance-testing.yaml @@ -36,46 +36,11 @@ jobs: env: CLOUDFLARE_UUID: ${{ secrets.CLOUDFLARE_UUID }} run: | - # Check if the inputs.endpoint starts with https:// or http:// - if [[ "${{inputs.endpoint}}" =~ ^https:// ]]; then - # Set the http_request_protocol to https if the URL starts with https:// - export http_request_protocol=https - elif [[ "${{inputs.endpoint}}" =~ ^http:// ]]; then - # Set the http_request_protocol to http if the URL starts with http:// - export http_request_protocol=http - else - # If the URL doesn't start with either http:// or https://, print an error and exit - echo "Please input a url with either https:// or http://" && exit 1 - fi - - # Check if inputs.endpoint is different from the default "http://localhost:9545" - if [ "${{inputs.endpoint}}" != "http://localhost:9545" ]; then - # Check if inputs.endpoint is not empty - if [ -n "${{inputs.endpoint}}" ]; then - # If inputs.endpoint isn't different from the default and is not empty, use inputs.endpoint - export endpoint_to_test=${{inputs.endpoint}} - # Remove the protocol (http:// or https://) from endpoint_to_test - endpoint_to_test=${endpoint_to_test#http://} - endpoint_to_test=${endpoint_to_test#https://} - else - # If inputs.endpoint is empty, strip the protocol from endpoint_to_test - endpoint_to_test=${endpoint_to_test#http://} - endpoint_to_test=${endpoint_to_test#https://} - fi - else - # If inputs.endpoint is "http://localhost:9545", strip the protocol from endpoint_to_test - endpoint_to_test=${endpoint_to_test#http://} - endpoint_to_test=${endpoint_to_test#https://} - fi - - # Replace -=endpoint_to_test=- placeholder in the art.yaml file with the endpoint_to_test value - sed -i "s/-=endpoint_to_test=-/${endpoint_to_test}/g" .github/actions/performance-tests/art.yaml - # Replace -=http_request_protocol=- placeholder in the art.yaml file with the http_request_protocol value - sed -i "s/-=http_request_protocol=-/${http_request_protocol}/g" .github/actions/performance-tests/art.yaml + echo "CLOUDFLARE_UUID=${{ secrets.CLOUDFLARE_UUID }}" >> ${GITHUB_ENV} + # Replace -=CLOUDFLARE_UUID=- placeholder in the art.yaml file with the correct value + sed -i "s/-=CLOUDFLARE_UUID=-/${CLOUDFLARE_UUID}/g" .github/actions/performance-tests/art.yaml - name: "EXECUTE:PERFORMANCE:TESTS" - env: - CLOUDFLARE_UUID: ${{ secrets.CLOUDFLARE_UUID }} run: | # Execute Artillery to run performance tests using the specified configuration file artillery run .github/actions/performance-tests/art.yaml \