Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Solve unreliable tests #1266

Merged
merged 8 commits into from
Oct 1, 2020
Merged

Solve unreliable tests #1266

merged 8 commits into from
Oct 1, 2020

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Sep 30, 2020

Description

Few tests are unreliable.
Related to singletons and build flavors.

How to test

  • Look through the code changes

Random could be randomly 0 which would fail the test.
Use these build variants for specific tests.
Until refactored, it's okay to recalculate this.
@d4rken d4rken added maintainers Tag pull requests created by maintainers 1.5.0 labels Sep 30, 2020
@sonarcloud
Copy link

sonarcloud bot commented Sep 30, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

41.2% 41.2% Coverage
0.0% 0.0% Duplication

@d4rken d4rken marked this pull request as ready for review October 1, 2020 07:24
@d4rken d4rken requested a review from a team October 1, 2020 07:24
Copy link
Contributor

@mertsafter mertsafter left a comment

Choose a reason for hiding this comment

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

LGTM. Noted one small code change but it's not a must.

@@ -54,18 +66,21 @@ class VerificationKeysTest {
}

companion object {
private const val PUB_KEY =
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about moving the companion object to the beginning of the class? I personally like to see all consts/companions at first of the class so I know what consts are used in the code

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 like the opposite, I think the constants distract from the global variables and constructor arguments.
Our goal is to follow the Kotlin code conventions which recommend companion objects at the end:
https://kotlinlang.org/docs/reference/coding-conventions.html

@d4rken d4rken merged commit 5001d7a into release/1.5.x Oct 1, 2020
@d4rken d4rken deleted the fix/flaky-tests branch October 1, 2020 09:25
@harambasicluka harambasicluka added this to the 1.5.0 milestone Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants