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

Add konsist tests #5214

Merged
merged 9 commits into from
Oct 2, 2023
Merged

Add konsist tests #5214

merged 9 commits into from
Oct 2, 2023

Conversation

Rawa
Copy link
Contributor

@Rawa Rawa commented Sep 29, 2023

This PR adds a bunch of konsist test to ensure we adhere to nice code standards.


This change is Reviewable

@linear
Copy link

linear bot commented Sep 29, 2023

DROID-380 Add Konsist tests

Add the hackday konsist tests to the repo

@Rawa Rawa added the Android Issues related to Android label Sep 29, 2023
@Rawa Rawa self-assigned this Sep 29, 2023
@Rawa Rawa force-pushed the add-konsist-tests-droid-380 branch 3 times, most recently from 7c6bfee to 4d84d22 Compare October 2, 2023 06:30
@Rawa Rawa changed the title Draft: Add konsist tests Add konsist tests Oct 2, 2023
@Rawa Rawa force-pushed the add-konsist-tests-droid-380 branch from 4d84d22 to d7382e8 Compare October 2, 2023 07:00
Copy link
Contributor

@Pururun Pururun left a comment

Choose a reason for hiding this comment

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

Reviewed 32 of 33 files at r1, 42 of 43 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Rawa Rawa force-pushed the add-konsist-tests-droid-380 branch 2 times, most recently from 228ded3 to 14040be Compare October 2, 2023 11:54
Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

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

Reviewed 33 of 43 files at r2, 2 of 3 files at r4, 35 of 35 files at r5, all commit messages.
Reviewable status: 75 of 76 files reviewed, 3 unresolved discussions (waiting on @Rawa)


android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ArchitectureTests.kt line 11 at r5 (raw file):

    @Test
    fun `domain layer depends on nothing`() {

I believe we should to refer to these as model(s) (or perhaps combine it somehow with "domain") until we've settled on a architectural long-term plan

Code quote:

domain

android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/GeneralTests.kt line 12 at r5 (raw file):

    @Test
    fun `package name must match file path`() {
        Konsist.scopeFromProject().packages.assert { it.hasMatchingPath }

Replace with the existing projectScope() extension. The same applies to the other test functions in this class

Code quote:

Konsist.scopeFromProject()

android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/extensions/KonsistExtensions.kt line 1 at r5 (raw file):

package net.mullvad.mullvadvpn.test.arch.extensions

I'm not sure whether this file is necessary or not. I believe it would be easiest to understand the code if we add all/most of the scope calls or none of them here to avoid a mix. Perhaps we can discuss this further outside of GH/Reviewable.

Copy link
Contributor

@sabercodic sabercodic left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r4, 15 of 35 files at r5, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Rawa)

Copy link
Contributor Author

@Rawa Rawa left a comment

Choose a reason for hiding this comment

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

Reviewable status: 63 of 76 files reviewed, 3 unresolved discussions (waiting on @albin-mullvad, @Pururun, and @sabercodic)


android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ArchitectureTests.kt line 11 at r5 (raw file):

Previously, albin-mullvad wrote…

I believe we should to refer to these as model(s) (or perhaps combine it somehow with "domain") until we've settled on a architectural long-term plan

Good point


android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/GeneralTests.kt line 12 at r5 (raw file):

Previously, albin-mullvad wrote…

Replace with the existing projectScope() extension. The same applies to the other test functions in this class

Aligned all tests


android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/extensions/KonsistExtensions.kt line 1 at r5 (raw file):

Previously, albin-mullvad wrote…

I'm not sure whether this file is necessary or not. I believe it would be easiest to understand the code if we add all/most of the scope calls or none of them here to avoid a mix. Perhaps we can discuss this further outside of GH/Reviewable.

Done.

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 43 files at r2, 1 of 3 files at r4, 13 of 13 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Rawa Rawa force-pushed the add-konsist-tests-droid-380 branch from b744cc3 to c7279b8 Compare October 2, 2023 13:54
Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Rawa Rawa force-pushed the add-konsist-tests-droid-380 branch from c7279b8 to 3f6a24d Compare October 2, 2023 14:06
Checks that the tests are prefixed with "ensure "
Copy link
Contributor Author

@Rawa Rawa left a comment

Choose a reason for hiding this comment

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

:lgtm:

Dismissed @albin-mullvad from a discussion.
Reviewable status: 71 of 77 files reviewed, all discussions resolved (waiting on @albin-mullvad, @Pururun, and @sabercodic)


android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/GeneralTests.kt line 12 at r5 (raw file):

Previously, Rawa (David Göransson) wrote…

Aligned all tests

Done.

@albin-mullvad albin-mullvad merged commit bb3737b into main Oct 2, 2023
10 checks passed
@albin-mullvad albin-mullvad deleted the add-konsist-tests-droid-380 branch October 2, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues related to Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants