Closed smuralee closed 4 years ago
@smuralee
02 Sep 20 18:10 UTC ERR Error parsing file error="/home/ec2-user/go/src/github.com/aws/aws-controllers-k8s/pkg/generate/config/config.go:189:60: Operation not declared by package api" dry-run=false version=2.2.1
copy mockery binary to under /home/ec2-user/go/bin which should resolve above issue as your GOPATH
is /home/ec2-user/go
_cgo_export.c:3:20: fatal error: stdlib.h: No such file or directory compilation terminated.
This seems there is no system headers installed. Either install them sudo yum install make glibc-devel gcc patch
or try setting CGO_ENABLED=0 and see if that helps!
@nithu0115
copy mockery binary to under /home/ec2-user/go/bin which should resolve above issue as your GOPATH is /home/ec2-user/go
Mockery was installed with Homebrew and it was on the path. I have moved it to $GOPATH/bin
using go get github.com/vektra/mockery/v2/.../
but the error is there.
03 Sep 20 07:02 UTC ERR Error parsing file error="/home/ec2-user/go/src/github.com/aws/aws-controllers-k8s/pkg/generate/config/config.go:189:60: Operation not declared by package api" dry-run=false version=0.0.0-dev
/home/ec2-user/go/bin/mockery --tags=codegen --case=underscore --output=mocks/pkg/generate/testdata/ --dir=pkg/generate/testdata/ --all
This seems there is no system headers installed. Either install them sudo yum install make glibc-devel gcc patch or try setting CGO_ENABLED=0 and see if that helps!
Setting CGO_ENABLED=0
in .bash_profile
resolved it. Thanks!
Temporary credentials generated
deployment.apps/ack-s3-controller env updated
Added AWS Credentials to env vars map
======================================================================================================
To poke around your test manually:
export KUBECONFIG=/home/ec2-user/go/src/github.com/aws/aws-controllers-k8s/scripts/../build/tmp-test-bb733669/kubeconfig
kubectl get pods -A
======================================================================================================
bucket.s3.services.k8s.aws/ack-test-smoke-s3-123456789012 created
{
"CreationDate": "2020-09-03T07:04:21.000Z",
"Name": "ack-test-smoke-s3-123456789012"
}
bucket.s3.services.k8s.aws "ack-test-smoke-s3-123456789012" deleted
smoke took 23 second(s)
To resume test with the same cluster use: "-c /home/ec2-user/go/src/github.com/aws/aws-controllers-k8s/scripts/../build/tmp-test-bb733669"
Mockery was installed with Homebrew and it was on the path. I have moved it to
$GOPATH/bin
usinggo get github.com/vektra/mockery/v2/.../
but the error is there.
I tried replicating the same on AL2 and had no issues. I used ./scripts/install_mockery.sh
to get the binary and manually copied the mockery binary under $GOPATH/bin
. However, I haven't tried using Homebrew. Try doing it this way and see if that helps!
I tried replicating the same on AL2 and had no issues. I used ./scripts/install_mockery.sh to get the binary and manually copied the mockery binary under $GOPATH/bin. However, I haven't tried using Homebrew. Try doing it this way and see if that helps!
@nithu0115 Didn't work for me. For my local macOS I had to change the download to mockery Darwin_x86_64.tar.gz and the same error came up again. It's the awssdkmodel.Operation
which is having issues. I have got the Go SDK with go get -u github.com/aws/aws-sdk-go/...
Make sure you are supplying the -tags codegen
if you call mockery
. The awssdkmodel.Operation
is a struct that is in a "hidden" package aws-sdk-go/private/model/api
that is guarded by a build: codegen
tag:
@jaypipes Yes the tag is passed and this issue does not happen with mockery 1.0.1
. The 2.1.0
gives those errors.
I can confirm that this issue doesn't happen with any mockery of version v1.x.x
. Using v2.x.x
the flag --tags
doesn't seem to solve it, i guess this is happening because mockery doesn't build the vendors with the given build tags.
I'll open an issue in the mockery repository and send a PR fixing scripts/install-mockery
for now
Thanks for the mockery PR. v2 has this issue fixed now so feel free to move back to that when you are ready.
Thanks for the help and patch release @LandonTClipp
I tested make mocks
with mockery v2.2.2
and it's working as expected.
Describe the bug Mockery dry-run fails for
make kind-test SERVICE=s3
Steps to reproduce
Expected outcome Successful execution of the kind-test for this S3 service
Environment