Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gotest fails because go-sqlite3 is unable to be compiled #465

Open
shackra opened this issue Jun 20, 2024 · 1 comment
Open

gotest fails because go-sqlite3 is unable to be compiled #465

shackra opened this issue Jun 20, 2024 · 1 comment
Labels
flake Related to running in pure environments

Comments

@shackra
Copy link

shackra commented Jun 20, 2024

gotest...................................................................Failed
- hook id: gotest
- exit code: 1

--- FAIL: TestCreateFixture (0.00s)
    data_test.go:11:
                Error Trace:    /build/src/cmd/db-creator/data_test.go:11
                Error:          Received unexpected error:
                                sqlite: check foreign_keys pragma: reading schema information Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
                Test:           TestCreateFixture
FAIL
FAIL    github.com/shackra/keisy-ian/cmd/db-creator     0.006s
FAIL

Since flakes do not admit environment variables, not even with --impure flag passed, it seems impossible to let this check pass without setting CGO_ENABLED=1.

@shackra
Copy link
Author

shackra commented Jun 20, 2024

My best workaround was to use github.com/ncruces/go-sqlite3

_ "github.com/ncruces/go-sqlite3/driver"
_ "github.com/ncruces/go-sqlite3/embed"

@sandydoo sandydoo added the flake Related to running in pure environments label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flake Related to running in pure environments
Projects
None yet
Development

No branches or pull requests

2 participants