My golang test pipeline crashes

testing:
stage: test
script:
- GOPATH="/var/lib/gitlab-runner/go" GO111MODULE=on make test

The pipeline step above causes:

Failed to compile test: # gitlab.com/myAwesomeProject/dependency/github.com/google/gopacket/pcap

/var/lib/gitlab-runner/go/pkg/mod/gitlab.com/dependency/dependency/github.com/google/gopacket@v0.0.0-20220201201003-f5feb82ddd48/pcap/pcap_unix.go:34:10: fatal error: pcap.h: No such file or directory

#include <pcap.h>
^~~~~~~~
compilation terminated.

Anyone experiences with Golang test pipelines ? I have a feeling that this pipeline does not know that it needs to download pcap.h, any advice ?

I do not think this is related totest at all, it just seems as if something in your dependency tree requires the libpcap-devel package installed on the system.

1 Like