-
Notifications
You must be signed in to change notification settings - Fork 527
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
[BUG]: Instrumentation tests fail to build #5334
Comments
From a From that PR, it seems extremely likely the issue was introduced from this line: https://github.com/oppia/oppia-android/pull/5098/files#diff-b39b7c940cf9f44a11a5f82a5395e85f4f08cbf5117a9d8df38b267a3a64bf76R28. This makes sense since Given how large #5098 is, I think I'm going to opt for a fix-forward since the regression is fully isolated to |
@BenHenning, the line linked in you comment above doesn't actually load to the expected line when url is clicked. Could you link it on develop? |
This does build on CI? could it be related to your OS? |
@adhiamboperes we don't build instrumentation tests on CI which is why this was missed originally. While I'm only using Linux, it fails on both of my workstations that I tried setting it up on, and in CI when updated to include the builds (see #5335). |
## Explanation Fixes #5334 Fixes #3618 The root issue is that ``//instrumentation`` was updated in #5098 to depend on ``//testing``. However, the current dexer that we use in Bazel has troubles dexing certain dependencies (including Robolectric & Mockito), and since ``//testing`` transitively pulls in these test dependencies, the instrumentation test binaries fail to build. The main fix is isolating the new Firebase testing dependencies to their own package instead of needing to pull in ``//testing``. This resulted in some broad but trivial changes in other tests throughout the codebase. Note that I opted for just updating ``//testing`` rather than all affected deps lists to keep things a bit simpler (stricter deps will fix this in a later PR as part of the Bazel chain using automation to make things a lot simpler). This addresses issue #5334. To keep this from happening again in the future, new smoke build tests were added for instrumentation tests and the top-level ``//instrumentation:oppia_test`` to ensure that our ``ComputeAffectedTests`` utility correctly identifies and picks up these tests as part of the CI run when relevant (historically, instrumentation tests have been completely ignored in CI since they can't be run yet; note this doesn't include the instrumentation package's unit tests since these use Robolectric and _are_ included in CI runs). This addresses issue #3618. Note that this was verified as working using an initial commit to this PR that only added the new smoke tests and verifying that ``//instrumentation:oppia_test_binary_smoke_test`` is now picked up and fails, per the log output (& CI results): ``` BAZEL_TEST_TARGETS: //instrumentation:oppia_test_binary_smoke_test ``` Finally, note that there are a couple of new test targets added under ``//domain/src/test/java/org/oppia/android/domain/auth`` since it was noticed during the development of #5138 that these were missed in an earlier commit to develop (and should be run in both Bazel & Gradle test passes). ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only N/A -- This change only targets & fixes test-only infrastructure.
Describe the bug
Instrumentation tests are currently failing to build in Bazel. Specifically, the
//instrumentation:oppia_test
build is failing with the following error:Steps To Reproduce
Check out the latest develop (604b609) and try to build:
bazel build //instrumentation:oppia_test
.Expected Behavior
Instrumentation tests should build successfully.
Screenshots/Videos
No response
What device/emulator are you using?
N/A
Which Android version is your device/emulator running?
N/A
Which version of the Oppia Android app are you using?
N/A
Additional Context
No response
The text was updated successfully, but these errors were encountered: