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

Fix VoiceRecorderLTests by faking OggOpusEncoder #7226

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

jmartinesp
Copy link
Member

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other : Fix broken tests.

Content

Used a fake OggOpusEncoder in VoiceRecorderLTests to fix some broken tests.

Motivation and context

VoiceRecorderLTests depended on the native Opus encoder to run. By using a fake and mimicking its behaviour we can avoid the tests failures we've seen in the CI.

Tests

  • Run VoiceRecorderLTests in the CI, see that they pass.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 13

Checklist

@jmartinesp jmartinesp self-assigned this Sep 23, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@jmartinesp jmartinesp marked this pull request as ready for review September 23, 2022 15:19
@jmartinesp jmartinesp requested review from a team and yostyle and removed request for a team September 23, 2022 17:00
@@ -99,7 +99,7 @@ ext.libs = [
'flipperNetworkPlugin' : "com.facebook.flipper:flipper-network-plugin:$flipper",
],
element : [
'opusencoder' : "io.element.android:opusencoder:1.0.4",
'opusencoder' : "io.element.android:opusencoder:1.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

any notable changes with the dependency update?

Copy link
Member Author

Choose a reason for hiding this comment

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

OggOpusEncoder is now an interface to make mocking it easier. Also, we had to separate the old external fun setBitrate into fun setBitrate and external fun setEncoderBitrate as mockk can't mock external funs.

Copy link
Contributor

@ouchadam ouchadam left a comment

Choose a reason for hiding this comment

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

LGTM 💯

@jmartinesp jmartinesp merged commit 90e4760 into develop Sep 26, 2022
@jmartinesp jmartinesp deleted the tech/fix-voice-recording-l-tests branch September 26, 2022 09:32
@ouchadam ouchadam mentioned this pull request Sep 26, 2022
6 tasks
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