From 6f0d8de75b4ea0c29efb7c6c5bd8b889f2f09359 Mon Sep 17 00:00:00 2001 From: Kush Trivedi Date: Tue, 15 Dec 2020 20:04:37 +0530 Subject: [PATCH 1/3] fix: run nighthawk through binary Signed-off-by: Kush Trivedi --- .github/workflows/ci.yml | 10 ++++------ apinighthawk/nighthawk.go | 15 ++------------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96ecfa8f..e5079295 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: golangci-lint - uses: golangci/golangci-lint-action@v1 + uses: golangci/golangci-lint-action@v2 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.29 + version: v1.32 # Optional: working directory, useful for monorepos # working-directory: somedir @@ -54,9 +54,6 @@ jobs: export BUILDIFIER_BIN=$GOPATH/bin/buildifier go get -u github.com/bazelbuild/buildtools/buildozer export BUILDOZER_BIN=$GOPATH/bin/buildozer - git clone https://github.com/envoyproxy/envoy - cd envoy - bazel build //source/exe:envoy-static -c opt test-assets: strategy: matrix: @@ -75,6 +72,7 @@ jobs: - name: start build run: | chmod +x ./apinighthawk/bin/nighthawk_client + export PATH=apinighthawk/bin/nighthawk_client cd apinighthawk/bin chmod +x nighthawk_client - ./nighthawk_client --rps 3 --concurrency 5 --duration 30 https://github.com \ No newline at end of file + nighthawk_client --rps 3 --concurrency 5 --duration 30 https://github.com --output-format experimental_fortio_pedantic \ No newline at end of file diff --git a/apinighthawk/nighthawk.go b/apinighthawk/nighthawk.go index f857a0a4..9efdfc44 100644 --- a/apinighthawk/nighthawk.go +++ b/apinighthawk/nighthawk.go @@ -21,18 +21,9 @@ type NighthawkConfig struct { // NighthawkRun function runs the nighthawk loadtest func NighthawkRun(config *NighthawkConfig) ([]byte, error) { - imageName := "envoyproxy/nighthawk-dev" - _, err := exec.Command("docker", "inspect", imageName).Output() - if err != nil { - msg := "Setup nighthawk image before executing load-test" - err = errors.Wrapf(err, msg) - log.Error(err) - return nil, err - } - rURL, _ := url.Parse(config.URL) if !rURL.IsAbs() { - err = fmt.Errorf("please give a valid URL %s", config.URL) + err := fmt.Errorf("please give a valid URL %s", config.URL) log.Error(err) return nil, err } @@ -49,9 +40,7 @@ func NighthawkRun(config *NighthawkConfig) ([]byte, error) { log.Info("Received arguments for run", args) - out, err := exec.Command("docker", "run", - "envoyproxy/nighthawk-dev:latest", - "nighthawk_client", + out, err := exec.Command("nighthawk_client", "--rps "+qps, "--concurrency 1", "--connections "+c, From 145424984dae26f45599ba7ce7ee4fb85d6d1b0c Mon Sep 17 00:00:00 2001 From: Kush Trivedi Date: Tue, 15 Dec 2020 20:07:38 +0530 Subject: [PATCH 2/3] fix: path Signed-off-by: Kush Trivedi --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5079295..cd914bf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: - name: start build run: | chmod +x ./apinighthawk/bin/nighthawk_client - export PATH=apinighthawk/bin/nighthawk_client cd apinighthawk/bin chmod +x nighthawk_client + export PATH="$PATH:/" nighthawk_client --rps 3 --concurrency 5 --duration 30 https://github.com --output-format experimental_fortio_pedantic \ No newline at end of file From 729dfa0cbe8c44a7e05d69d1b0dcdb86836ad8ca Mon Sep 17 00:00:00 2001 From: Kush Trivedi Date: Tue, 15 Dec 2020 20:11:48 +0530 Subject: [PATCH 3/3] fix: path Signed-off-by: Kush Trivedi --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd914bf9..48000772 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,8 @@ jobs: - name: start build run: | chmod +x ./apinighthawk/bin/nighthawk_client - cd apinighthawk/bin + cd apinighthawk + export PATH=$PATH:$(pwd)/bin + cd bin chmod +x nighthawk_client - export PATH="$PATH:/" nighthawk_client --rps 3 --concurrency 5 --duration 30 https://github.com --output-format experimental_fortio_pedantic \ No newline at end of file