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 tests pipeline #222

Merged
merged 12 commits into from
Apr 16, 2024
Merged

Add tests pipeline #222

merged 12 commits into from
Apr 16, 2024

Conversation

amberin
Copy link
Member

@amberin amberin commented Apr 13, 2024

I have worked on this for quite some time in my fork. Those damn flaky Espresso tests...

I believe the tests are now stable enough. The job may still fail occasionally because of some infrastructure issue with GitHub, but it's usually pretty easy to find the cause in the output.

I decided to remove the "build" workflow, since I feel running the tests should be the main check to do when accepting contributions, and an APK is always built as part of that process.

I'm thinking the next step is to run tests on multiple API versions (lowest and highest supported), but when I tried some other API versions than 29, it seemed like some tweaking is needed before everything works properly. So I'm thinking this should be an acceptable first step.

amberin and others added 12 commits April 11, 2024 17:55
To align it with minSdkVersion in app/build.gradle.
After some experiments with "retry" test rules and "wait for view with
ID" utility functions, I have decided I prefer "dumb" sleeps in the
right places. It clearly identifies the problematic parts of the tests,
and I believe this has benefits compared to simply re-trying any failing
tests without knowing where the problem is.
Now that we have a test pipeline, that's the important check to look at
it, and since it builds an APK, this job becomes superfluous.
This is needed for NotEventsTest.agenda_MultipleWithTimes(), among
others.
MiscTest.fragmentTest() is insanely flaky, and it already has sleeps in many
places since way back. Sometimes those sleeps just aren't enough, but
increasing them would mean slowing everything down a lot. A retry rule
is the only working solution I have found.

NoteFragmentTest.testContentLineCountUpdatedOnNoteUpdate() is also
just too damn flaky, and I cannot understand where the problem is. It
just seems that, sometimes, onRecyclerViewItem() will not work, and
waiting for the right ID does not help.
When a pull request is created from a fork, our repository secrets are
not available to the workflow runner.
@amberin amberin linked an issue Apr 14, 2024 that may be closed by this pull request
Copy link
Contributor

@chvp chvp left a comment

Choose a reason for hiding this comment

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

LGTM

@amberin amberin merged commit 404e6dd into orgzly-revived:master Apr 16, 2024
1 check passed
@amberin amberin deleted the tests-pipeline-pr branch April 16, 2024 21:10
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.

Run tests in Github Actions workflow
3 participants