godredd

Dredd not killing main.go fix needed


I'm new to this tool and looking for help with what I'm sure is a common issue.

As I understand dredd isn't able to kill processes that it started, for me this is main.go.

My test feature is working great but the second time I obviously run into issues at the port is in use.

I've read most of the articles and guides out there but I'm not able to understand how to implement the necessary fix.

I tried creating script/test.sh

  #!/bin/sh
  go run main.go
  sleep 3
  PID=$!
  dredd apiary.apib http://localhost:5000/
  RESULT=$?
  kill -9 $PID
  exit $RESULT

and then running ./scripts/test.sh instead of dredd but its not working at all.

What is the best way to implement a fix for this that would also work on circleCI?


Solution

  • figured it out.

    I had to delete the dredd.yml file and run

    $ go build

    then

    $ dredd apiary.apib http://127.0.0.1:5000 --server=./go-project --language=go

    But circleCI testing is not working, it just seems to ignore the circle.yml file and skips straight past it.