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

Cleanup SQLite tests #3246

Merged
merged 18 commits into from Aug 25, 2023
Merged

Conversation

noisersup
Copy link
Member

@noisersup noisersup commented Aug 23, 2023

Description

Closes #3131.

Readiness checklist

  • I added/updated unit tests (and they pass).
  • I added/updated integration/compatibility tests (and they pass).
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Milestone (Next), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #3246 (656125b) into main (6601d82) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3246      +/-   ##
==========================================
- Coverage   75.20%   75.17%   -0.03%     
==========================================
  Files         400      400              
  Lines       22386    22386              
==========================================
- Hits        16835    16829       -6     
- Misses       4574     4580       +6     
  Partials      977      977              
Files Changed Coverage Δ
integration/helpers.go 87.94% <100.00%> (ø)

... and 6 files with indirect coverage changes

Flag Coverage Δ
integration 71.59% <100.00%> (-0.05%) ⬇️
mongodb 5.25% <100.00%> (+<0.01%) ⬆️
pg 64.65% <100.00%> (-0.03%) ⬇️
shard-1 56.74% <100.00%> (-0.08%) ⬇️
shard-2 56.19% <100.00%> (-0.12%) ⬇️
shard-3 54.83% <100.00%> (-0.07%) ⬇️
sqlite 46.99% <100.00%> (-0.02%) ⬇️
unit 24.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@noisersup noisersup added code/chore Code maintenance improvements not ready Issues that are not ready to be worked on; PRs that should skip CI and removed not ready Issues that are not ready to be worked on; PRs that should skip CI labels Aug 23, 2023
@noisersup noisersup marked this pull request as ready for review August 24, 2023 15:06
@noisersup noisersup requested a review from a team as a code owner August 24, 2023 15:06
@noisersup noisersup enabled auto-merge (squash) August 24, 2023 15:06
@noisersup noisersup changed the title Sqlite tests cleanup 3131 Sqlite tests cleanup Aug 24, 2023
@noisersup noisersup requested review from a team and chilagrow August 24, 2023 15:07
@AlekSi AlekSi added this to the Next milestone Aug 25, 2023
@@ -158,7 +153,7 @@ func testAggregateStagesCompatWithProviders(tt *testing.T, providers shareddata.
})
}

if tc.failsForSQLite != "" && setup.IsSQLite(tt) {
if setup.IsSQLite(tt) {
Copy link
Member

Choose a reason for hiding this comment

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

That bit is problematic: we will be looking for TODO issue URLs and "failsforsqlite" strings, and that line has neither. Makes me wonder how many problems like that we already have…

Let's add a TODO comment with an issue at least

Comment on lines +241 to +242
// TODO https://github.com/FerretDB/FerretDB/issues/3148
if setup.IsSQLite(tt) {
Copy link
Member

Choose a reason for hiding this comment

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

Great, we need to do the same everywhere

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@noisersup noisersup requested a review from AlekSi August 25, 2023 09:40
update: bson.D{{"$inc", bson.D{{"v.100", int32(42)}}}},
},
"DotNotationArrayFieldNotExist": {
"DotNotArrayFieldNotExist": {
Copy link
Member

Choose a reason for hiding this comment

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

"Not array field not exists". While the test is actually about array, not "not array".

I think that abbreviation of dot notation is unfortunate. It also does not quite belong to that PR/issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

We need to shorten those names as they are longer than 64 characters so they always fail

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why they become longer if we don't change them, but okay, let's shorten them some other non-confusing way

Copy link
Member Author

Choose a reason for hiding this comment

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

They are already too long since creation. We just don't see it as they fail in the same way both on MongoDB and FerretDB. We could actually panic or fail if the name is too long to omit such situation in the future

Copy link
Member

Choose a reason for hiding this comment

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

Oh, that's bad…

Copy link
Member

Choose a reason for hiding this comment

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

@noisersup is it done?

Copy link
Member Author

Choose a reason for hiding this comment

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

I replaced the names with less confusing ones, currently waiting for CI to pass, I'm also investigating why the tests were passing, although not sure if that should be covered in this PR in your opinion

Copy link
Member

Choose a reason for hiding this comment

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

I think we should at least understand why that was happening

Copy link
Member Author

Choose a reason for hiding this comment

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

Found it, it's due to the fact that we append _sqlite at the end of the database name

Copy link
Member Author

Choose a reason for hiding this comment

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

If we want to avoid name mangling I guess we are forced to shorten our db names.

@noisersup noisersup requested a review from AlekSi August 25, 2023 10:18
Copy link
Member

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

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

Please re-request review once ready

@noisersup noisersup requested a review from AlekSi August 25, 2023 12:00
@AlekSi AlekSi changed the title Sqlite tests cleanup Cleanup SQLite tests Aug 25, 2023
@AlekSi AlekSi disabled auto-merge August 25, 2023 13:54
@AlekSi AlekSi merged commit a71936d into FerretDB:main Aug 25, 2023
31 checks passed
yonarw pushed a commit to yonarw/FerretDB that referenced this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Make all integration tests "pass" with SQLite
2 participants