buildkite syntax error when running code coverage on golang

77 Views Asked by At

I'm running the following make target in a buildkite step

cover:
    go test ./... -coverprofile=coverage.out 
    ccover=$$(go tool cover -func cover.out | grep total | grep -Eo '[0-9]+\.[0-9]+');
    if [ $$(bc <<< "$$ccover < 20.0") -eq 1 ]; then\
        exit 1;\
    fi

This is what my buildkite yaml looks like

  - label: ":coverage: check code coverage"
    key: "cvg"
    command:
      - make cover

Now when this executes on the server I get the following error

/bin/sh: syntax error: unexpected redirection
make: *** [Makefile:20: analysecover] Error 2
Error: The command exited with status 1

Any idea on what could be going wrong here ?

0

There are 0 best solutions below