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

Integration test "framework" #846

Closed
wants to merge 7 commits into from
Closed

Integration test "framework" #846

wants to merge 7 commits into from

Conversation

mieciu
Copy link
Member

@mieciu mieciu commented Oct 4, 2024

How to run this:

cd ci/it
go test -v

What I really wanted to achieve here is to provide some sort of separation between test infra setup and the tests themselves.

The ITs are listed in ci/it/integration_test.go.
Each test is a separate struct living a a separate file. The test struct exposes handy methods like RequestToQuesma(), RequestToElasticsearch(), ExecuteClickHouseStatement() and a.ExecuteClickHouseQuery().
The whole test logic lives in overriden RunTests function.
Under the hood, there's whole machinery which spins up required docker containers and creates dedicated Quesma config file based on the provided template. Good news is, one does not have to touch it in order to run and contribute to the tests 😉

@mieciu mieciu changed the title e2e tests Integration test "framework" Oct 4, 2024
@mieciu mieciu marked this pull request as ready for review October 7, 2024 09:37
@mieciu mieciu requested a review from a team as a code owner October 7, 2024 09:37
Error wording fixes

test

remove dup

simplify

simplify

one more test

scaffolding for github ci job

scaffolding for github ci job

scaffolding for github ci job

remove śmieszkowanie
// This returns 500 Internal Server Error, but will be tackled in separate PR.
// (The table has not yet been discovered by Quesma )
// ERR quesma/quesma/quesma.go:198 > quesma request failed: Q2002: Missing table. Table: test_table: can't load test_table table opaque_id= path=/test_table/_search reason="Missing table." request_id=01926654-b214-7e1d-944a-a7545cd7d419
resp, err = a.RequestToQuesma(ctx, "GET", "/test_table/_search", []byte(`{"query": {"match_all": {}}}`))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An idea for the future: we could also test if Elastic's go client can connect to Quesma and query it correctly

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like it! 💯

@mieciu mieciu added this pull request to the merge queue Oct 7, 2024
@mieciu mieciu removed this pull request from the merge queue due to a manual request Oct 7, 2024
@mieciu mieciu enabled auto-merge October 7, 2024 10:37
@mieciu mieciu added this pull request to the merge queue Oct 7, 2024
@mieciu mieciu removed this pull request from the merge queue due to a manual request Oct 7, 2024
@mieciu mieciu enabled auto-merge October 7, 2024 10:58
@mieciu mieciu disabled auto-merge October 7, 2024 11:07
@mieciu mieciu enabled auto-merge October 7, 2024 11:07
@mieciu mieciu disabled auto-merge October 7, 2024 11:15
@mieciu mieciu enabled auto-merge October 7, 2024 11:15
@mieciu mieciu closed this Oct 7, 2024
auto-merge was automatically disabled October 7, 2024 11:16

Pull request was closed

@mieciu mieciu reopened this Oct 7, 2024
@mieciu mieciu closed this Oct 7, 2024
github-merge-queue bot pushed a commit that referenced this pull request Oct 7, 2024
Having problems with GitHub CI lately, so just in case I closed the
[older PR](#846) and created
this one 🤞
@mieciu mieciu deleted the e2e-test branch October 7, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants