Skip to content

Commit

Permalink
Merge pull request #24 from kushthedude/ciFix
Browse files Browse the repository at this point in the history
fix: run nighthawk through binary
  • Loading branch information
kushthedude authored Dec 15, 2020
2 parents a773c8a + 729dfa0 commit 035e4d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -75,6 +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
./nighthawk_client --rps 3 --concurrency 5 --duration 30 https://github.com
nighthawk_client --rps 3 --concurrency 5 --duration 30 https://github.com --output-format experimental_fortio_pedantic
15 changes: 2 additions & 13 deletions apinighthawk/nighthawk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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,
Expand Down

0 comments on commit 035e4d8

Please sign in to comment.