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

Adjust PlayLog test setup #2

Merged
merged 10 commits into from
May 29, 2024
Merged

Adjust PlayLog test setup #2

merged 10 commits into from
May 29, 2024

Conversation

stoyicker
Copy link
Member

See commit messages

This allows idiomatic usage when creating MockResponses for a custom dispatcher
…tion

This is safer in case the constructor ever triggers network calls.
This means refactoring DI to inject a TestScope for DefaultEventReporter so we
can perform assertions on what we send to EventProducer reliably. Some of the
new symbols are introduced in other modules, so they have been prefixed to
indicate that they are there because of the PlayLogTest. Other renames have
ocurred for consistency with this.

The new DI setup allows providing DefaultEventReporter with a TestScope,
meaning that  the for-now only test now runs inside a runTest block, and its
wait for MediaProductEnded switches out the CoroutineContext away from the test
one into a regular one so that the wait actually happens since we need playback
to occur for real.
This is to avoid side-effects and for readability.
For a Credentials instance to be considered logged in it needs to have non-null
both userId and token. Since we need our instance to be logged in, we need to
respect that.
We do not depend on it being valid so making it invalid will raise errors if
that accidentally changes.
This ensures we behave correctly when certain values are null.
@stoyicker stoyicker requested a review from a team as a code owner May 28, 2024 08:29
@stoyicker stoyicker enabled auto-merge May 28, 2024 08:29
@stoyicker stoyicker force-pushed the jantonio/playlog_test_setup branch from 96efc31 to 123080e Compare May 28, 2024 08:36
Copy link
Contributor

@kgrevehagen kgrevehagen left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple of questions!

@stoyicker stoyicker force-pushed the jantonio/playlog_test_setup branch from 123080e to c1aff26 Compare May 29, 2024 07:44
@stoyicker stoyicker added this pull request to the merge queue May 29, 2024
Merged via the queue into main with commit c85dd75 May 29, 2024
7 checks passed
@stoyicker stoyicker deleted the jantonio/playlog_test_setup branch May 29, 2024 08:33
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.

2 participants