-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
test(deck-options): discard changes dialog #17851
base: main
Are you sure you want to change the base?
Conversation
01090ff
to
6f5452b
Compare
Mostly to get a framework in place for testing DeckOptions Some of it will want to be abstracted at a later date The WebView based timing issues are painful. As is 'actuallyClose', which launches a task to close 10ms was sufficient for the WebView, but I wanted some leeway for CI `isClosingFragment` seemed easier than waiting on tasks, even if less architecturally pure. It also means we listen to task start, rather than task finish Issue 14438
Issue 14438 ---- This was a difficult change to make: * timing considerations on WebView callbacks I spent time time trying to use `onView` inside `onActivity`. After research, `onView` should be outside the `onActivity` hook: https://stackoverflow.com/a/64284563
6f5452b
to
51e1cbd
Compare
I'm in here working on this for the last commit. I'll have an emulator test workflow change that lets you specify iteration count in few minutes. Or maybe a half hour, but I'll get it. May be noisy though as I develop it, apologies |
cc502ea
to
f52f656
Compare
emulator workflow matrix construction is correct now, generated runs are named well, just need to re-align the "required" check list. I think a close/open will do that? Unsure but the name I'm generating appears correct now and matches the unit test style. |
Not quite, but close. Will wait for the run to complete then examine the settings to see if the check name is different, try remove/re-add from branch protection rules etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks fine - nice set of solutions to make it all work.
I'm taking the opportunity based on the prompt to run it a lot in CI to add the unit test iteration feature to the emulator workflow
Bear with me while I get it correct. Then we can hammer this one and make sure it doesn't flake.
this is the same idea from the unit test workflow that lets us dynamically expand our matrix based on manual workflow input from GitHub web UI
f52f656
to
48b3658
Compare
got it. zero-based array for the iteration in the name, not 1-based, I was generating iteration 1 as the first (and default only) run, but the required check was looking for iteration 0. Should pass now. And we should be able to hammer it now. |
I have a 30 iteration run going on my fork, if it passes, I'm good with it https://github.com/mikehardy/Anki-Android/actions/runs/12980212524 |
10% flakes :-), so it needs some work. But finding the problem is step 1 |
Purpose / Description
@Arthur-Milchior said this would be hard. I knew he was right, and I did it anyway. I would regret my time spent here, but it will hopefully lead to more regression coverage for our backend pages
Issue
Approach
DeckOptions.isClosingFragment
)How Has This Been Tested?
Warning
This needs a number of reruns in CI to be sure it's stable
Learning (optional, can help others)
This is the first test of
anki.pages
, and hopefully will allow us to stop a few 'brown paper bag' bugs in future, such as when we broke StatisticsonView
can't be called insideonActivity
. There feels like a lot of bad advice here, and the easy option is to move the assertion outsideonActivity
: https://stackoverflow.com/questions/61953249/how-to-access-activity-from-activityscenarioruleChecklist