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

chore: add C collation to postgres e2e and testcontainer #15388

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

lucaCambi77
Copy link
Contributor

@lucaCambi77 lucaCambi77 commented Oct 12, 2023

https://dhis2.atlassian.net/browse/DHIS2-15957

As discussed at the back meeting and agreed with @stian-sandvold, we are adding C collation as default to e2e and integration testing.

Note that:

The weird part here was that the Postgres docker image gets the locale from the OS, for example, en_US.utf-8 , however:

  • in e2e tests it doesn't use it for some reason. Eventually, it falls back probably to using a C collate or similar.
  • For integration tests, on the contrary, it gets and uses the proper locale.

C collation apparently is the best fit for dhis2. Note that this kind of collation is case-sensitive. So, for instance, A a B b will sort ascending A B a b.
Note also that this can impact ordering during testing. However, this might not be the case for instances because they might want to use a different collation. So the order in testing is arbitrary unless some type of order is required.
An alternative is to change the order collation at the query level

The same change will be applied to play instances when possible @Philip-Larsen-Donnelly

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #15388 (062f25e) into master (51fb710) will increase coverage by 16.67%.
Report is 2 commits behind head on master.
The diff coverage is n/a.

@@              Coverage Diff              @@
##             master   #15388       +/-   ##
=============================================
+ Coverage     49.48%   66.15%   +16.67%     
- Complexity    23291    31181     +7890     
=============================================
  Files          3489     3489               
  Lines        129699   129699               
  Branches      15136    15136               
=============================================
+ Hits          64176    85799    +21623     
+ Misses        59448    36807    -22641     
- Partials       6075     7093     +1018     
Flag Coverage Δ
integration 49.72% <ø> (?)
integration-h2 32.40% <ø> (-0.02%) ⬇️
unit 30.37% <ø> (ø)

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

see 1225 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a151ade...062f25e. Read the comment docs.

@lucaCambi77 lucaCambi77 requested a review from a team October 13, 2023 08:48
@lucaCambi77 lucaCambi77 marked this pull request as ready for review October 19, 2023 09:03
@lucaCambi77 lucaCambi77 requested a review from a team October 26, 2023 07:49
@sonarcloud
Copy link

sonarcloud bot commented Oct 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

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.

3 participants