Hi, I'm currently making PR for kratos and for som...
# contributors
r
Hi, I'm currently making PR for kratos and for some reason despite the fact that I can build and run it, tests fail with the following error:
Copy code
# github.com/ory/x/sqlcon
../go/pkg/mod/github.com/ory/x@v0.0.595/sqlcon/error_sqlite.go:18:22: undefined: sqlite3.Error
../go/pkg/mod/github.com/ory/x@v0.0.595/sqlcon/error_sqlite.go:20:16: undefined: sqlite3.ErrConstraintUnique
../go/pkg/mod/github.com/ory/x@v0.0.595/sqlcon/error_sqlite.go:22:16: undefined: sqlite3.ErrConstraintPrimaryKey
../go/pkg/mod/github.com/ory/x@v0.0.595/sqlcon/error_sqlite.go:28:16: undefined: sqlite3.ErrError
../go/pkg/mod/github.com/ory/x@v0.0.595/sqlcon/error_sqlite.go:32:16: undefined: sqlite3.ErrLocked
FAIL    github.com/ory/kratos/cipher [build failed]
FAIL    github.com/ory/kratos/cmd [build failed]
FAIL    github.com/ory/kratos/cmd/cleanup [build failed]
?       github.com/ory/kratos/cmd/jsonnet       [no test files]
FAIL    github.com/ory/kratos/cmd/clidoc [build failed]
FAIL    github.com/ory/kratos/cmd/courier [build failed]
FAIL    github.com/ory/kratos/cmd/identities [build failed]
FAIL    github.com/ory/kratos/cmd/serve [build failed]
FAIL    github.com/ory/kratos/continuity [build failed]
FAIL    github.com/ory/kratos/courier [build failed]
FAIL    github.com/ory/kratos/courier/template [build failed]
FAIL    github.com/ory/kratos/courier/template/email [build failed]
FAIL    github.com/ory/kratos/courier/template/sms [build failed]
FAIL    github.com/ory/kratos/driver [build failed]
FAIL    github.com/ory/kratos/driver/config [build failed]
ok      github.com/ory/kratos/embedx    (cached)
FAIL    github.com/ory/kratos/examples/go/identity/create [build failed]
FAIL    github.com/ory/kratos/examples/go/identity/delete [build failed]
FAIL    github.com/ory/kratos/examples/go/identity/get [build failed]
FAIL    github.com/ory/kratos/examples/go/identity/update [build failed]
FAIL    github.com/ory/kratos/examples/go/selfservice/error [build failed]
FAIL    github.com/ory/kratos/examples/go/selfservice/login [build failed]
FAIL    github.com/ory/kratos/examples/go/selfservice/logout [build failed]
FAIL    github.com/ory/kratos/examples/go/selfservice/recovery [build failed]
FAIL    github.com/ory/kratos/examples/go/selfservice/registration [build failed]
FAIL    github.com/ory/kratos/examples/go/selfservice/settings [build failed]
?       github.com/ory/kratos/internal/clihelpers       [no test files]
?       github.com/ory/kratos/internal/httpclient       [no test files]
?       github.com/ory/kratos/otp       [no test files]
FAIL    github.com/ory/kratos/examples/go/selfservice/verification [build failed]
FAIL    github.com/ory/kratos/examples/go/session/tosession [build failed]
FAIL    github.com/ory/kratos/hash [build failed]
FAIL    github.com/ory/kratos/hydra [build failed]
FAIL    github.com/ory/kratos/identity [build failed]
FAIL    github.com/ory/kratos/persistence/sql [build failed]
FAIL    github.com/ory/kratos/persistence/sql/batch [build failed]
FAIL    github.com/ory/kratos/persistence/sql/migratest [build failed]
FAIL    github.com/ory/kratos/request [build failed]
FAIL    github.com/ory/kratos/schema [build failed]
FAIL    github.com/ory/kratos/selfservice/errorx [build failed]
FAIL    github.com/ory/kratos/selfservice/flow [build failed]
FAIL    github.com/ory/kratos/selfservice/flow/login [build failed]
FAIL    github.com/ory/kratos/selfservice/flow/logout [build failed]
FAIL    github.com/ory/kratos/selfservice/flow/recovery [build failed]
FAIL    github.com/ory/kratos/selfservice/flow/registration [build failed]
FAIL    github.com/ory/kratos/selfservice/flow/settings [build failed]
?       github.com/ory/kratos/selfservice/sessiontokenexchange  [no test files]
FAIL    github.com/ory/kratos/selfservice/flow/verification [build failed]
FAIL    github.com/ory/kratos/selfservice/flowhelpers [build failed]
FAIL    github.com/ory/kratos/selfservice/hook [build failed]
FAIL    github.com/ory/kratos/selfservice/strategy/code [build failed]
FAIL    github.com/ory/kratos/selfservice/strategy/link [build failed]
FAIL    github.com/ory/kratos/selfservice/strategy/lookup [build failed]
?       github.com/ory/kratos/spec      [no test files]
FAIL    github.com/ory/kratos/selfservice/strategy/oidc [build failed]
FAIL    github.com/ory/kratos/selfservice/strategy/password [build failed]
FAIL    github.com/ory/kratos/selfservice/strategy/profile [build failed]
FAIL    github.com/ory/kratos/selfservice/strategy/totp [build failed]
FAIL    github.com/ory/kratos/selfservice/strategy/webauthn [build failed]
FAIL    github.com/ory/kratos/session [build failed]
ok      github.com/ory/kratos/test/schema       (cached)
?       github.com/ory/kratos/x/events  [no test files]
?       github.com/ory/kratos/x/swagger [no test files]
ok      github.com/ory/kratos/text      (cached)
FAIL    github.com/ory/kratos/ui/container [build failed]
FAIL    github.com/ory/kratos/ui/node [build failed]
FAIL    github.com/ory/kratos/x [build failed]
FAIL
'go get' and 'go mod download' do nothing here. I don't really understand what might be a reason for it. Is it good place to ask or should I create issue? I feel like it's prob some little dumb mistake on my part 😜
b
What command did you run to produce this output?
r
go test -short -tags sqlite ./...
i've wanted to make sure that tests pass before i add my own set of tests
it's almost clean fork of kratos with just 3 files changed
p
try use the makefile instead
make test
or
make test-short
might be best, otherwise it will test against multiple databases which is slow.
r
well
make test-short
does pretty much the same thing and has the same issues from what I can tell. Btw makefile uses
/bin/bash
as shell which is not compatible with NixOS, I think changing it to
/usr/bin/env bash
doesn't cause any issues on other distros but fixes it on NixOS, would ory accept PR for this little change?
p
yeah that makes sense
r
can that be bundled with my other PR or should I keep them separate
p
hmm, is this on the master branch and which go version are you using? I see some sqlite errors. We use https://github.com/mattn/go-sqlite3 Have you tried building kratos?
you'll have a faster review & merge if you separate them
r
yes, that's master branch, go version 1.21.3
okay I think I got it resolved, it was related to my setup and how NixOS works. Not gonna bore you with details as it's niche system. Sorry for bothering you 😛
p
all good 🙂