-
Notifications
You must be signed in to change notification settings - Fork 12
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
Test/kgw #446
Conversation
f098624
to
fe4d8a7
Compare
@@ -263,7 +264,7 @@ func (a *AbciApp) executeTx(ctx context.Context, rawTx []byte, logger *log.Logge | |||
Code: code.Uint32(), | |||
GasUsed: gasUsed, | |||
Events: events, | |||
Log: "success", | |||
Log: "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This I believe is useless and no logic is depended on it, not a breaking change.
@@ -121,7 +114,11 @@ action divide($numerator1, $numerator2, $denominator) public view { | |||
select $up AS upper_value, $down AS lower_value; | |||
} | |||
|
|||
@kgw(authn='true') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kgw shouldn't auth owner
actions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, an owner
actoin is not necessary need to be authed.
But an onwer view
action should(as user's identity is required) be, to be correctly used with KGW. I'll add this back to owner view
action.
Just to clearfy, kgw
annotation is not required for any action, kuneiform doesn't force it on any action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But an
onwer view
action should(as user's identity is required) be, to be correctly used with KGW. I'll add this back toowner view
action.
Ah, right right. I think that's what I was thinking -- non-transaction exec of owner view
action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I'm more about mark an action that require authn just for testing, not think this kf as a whole application. I should haha
As for the refactor on testing with better specification #392 (comment), I did a small iteration the result is not so good, I'll need more time on it. |
I'll combine unit-test and integration-test as they share some same env setups. |
test/integration/kgw_test.go
Outdated
defer helper.Teardown() | ||
|
||
helper.RunDockerComposeWithServices(ctx, []string{"kgw"}) | ||
// this is boot up time issue when running in CI, we just wait for a while |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually due to the kgw upstream health check dealy, kwilteam/kgw#11 should fix thix
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
go-version: '1.21.x' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github runner is using the pre-installed go already, but it still takes 40s to run this step
This pr is good to go. No more email bombs on test failed 🙃 To get this merged, since I changed the job's name to 'test', github branch rule on status checks need to be disabled temporarily as it requires both unit-test and acceptance-test pass. |
@@ -26,7 +26,7 @@ services: | |||
--root-dir=/app/kwil | |||
--log.level=${LOG_LEVEL:-info} | |||
--app.extension-endpoints=ext:50051 | |||
--app.admin-listen-addr=unix:///var/run/kwil/admin.sock | |||
--app.admin-listen-addr=unix:///tmp/admin.sock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we had the - /tmp:/var/run/kwil:rw
mapping in volumes:target
above for this. What was going wrong on the machine without this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'/var/run/kwil/admin.sock' just don't work locally on my pc, and I have to modify this manually everytime.
And I don't think we have to use this path for testing, as long as this path is inside the container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still working locally for me with a minor tweak (see comments).
@@ -216,7 +216,7 @@ tasks: | |||
- go test ./... -tags=ext_test -count=1 -race | |||
|
|||
test:it: | |||
desc: Run integration tests | |||
desc: Run integration tests ('short' mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an issue with this PR, but I was testing with go 1.22rc1 and I found that go mod vendor
fails with:
go: 'go mod vendor' cannot be run in workspace mode. Run 'go work vendor' to vendor the workspace or set 'GOWORK=off' to exit workspace mode.
This is documented:
golang/go#60056
With the addition of go work vendor
, the go mod vendor
command errors if there is a go.work file. Two ways we can consider dealing with this so it works on dev machines where there is likely a go.mod as well as CI and cloud build systems:
GOWORK=off go mod vendor
go mod vendor || go work vendor
For when 1.22 is release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it looks like if the vendor
directory is intended for use inside the docker image (while building) then it would need to be created with GOWORK=off go mod vendor
, not go work vendor
.
I think we should make this change to Taskfile.yml's vendor task definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah seems so. It's also a bit surprise bc we should not have go.work file anywhere for this workflow 🤔
.github/workflows/ci.yaml
Outdated
@@ -85,7 +85,8 @@ jobs: | |||
- name: Generate go vendor | |||
#for faster builds and private repos, need to run this after pb:compile:v1 | |||
run: | | |||
task vendor | |||
rm -rf vendor | |||
GOWORK=off go mod vendor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was on my local dev machine where I use task vendor
. Can we change the Taskfile instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, I used go mod vendor || go work vendor
so current workflow locally won't break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Merge away assuming CI passes still.
Alright, I'll temporary disable github branch check rules and merge it. |
* test kgw * go 1.22 compatiable `go mod vendor`
* test kgw * go 1.22 compatiable `go mod vendor`
* test kgw * go 1.22 compatiable `go mod vendor`
* test kgw * go 1.22 compatiable `go mod vendor`
* test kgw * go 1.22 compatiable `go mod vendor`
* test kgw * go 1.22 compatiable `go mod vendor`
Add tests with KGW.
What I did:
short
test modetask dev:testnet:up:nb
Tests are in integration tests, we probably should start using our own runners to run the tests, since integration tests will run longer and require more computing resources.. Right now our main CI workflow runs on our self-hosted github runner.The tests are ready to review.
I'm testing CI workflow, do not merge before the tests pass.