Skip to content

[Due for payment 2026-03-25] Investigate workflow job failing on main: test / test (job 7) #85243

Closed

Description

@github-actions

🚨 Failure Summary 🚨:

⚠️ Action Required ⚠️:

🛠️ A recent merge appears to have caused a failure in the job named test / test (job 7).
🔍 This issue has been automatically created and labeled with Workflow Failure for investigation.

👀 Please look into the following:

  1. Why the PR caused the job to fail?
  2. Address any underlying issues.

🐛 We appreciate your help in squashing this bug!

Issue OwnerCurrent Issue Owner: @ShridharGoel

Activity

  1. tgolen commented on Mar 13, 2026

    @tgolen
    Contributor

    Should be fixed with #85147. Re-running the tests now.

  2. tgolen commented on Mar 13, 2026

    @tgolen
    Contributor

    @MelvinBot Re-running the test, it still fails. Isn't this fixed on main?

  3. MelvinBot commented on Mar 13, 2026

    @MelvinBot
    Contributor

    The fix from PR #85147 is included in this re-run (the workflow commit c5fca4f is 48 commits ahead of PR #85147's merge), but the test is still failing because this is a different bug than what #85147 fixed.

    PR #85147 fixed: The react-native-permissions mock (RESULTS.GRANTED was undefined due to a bad import path).

    This failure is: expo-location's requestForegroundPermissionsAsync() returning undefined, causing TypeError: Cannot read properties of undefined (reading 'status') at src/libs/getCurrentPosition/index.ts:10.

    Root Cause

    The jest-expo preset mocks all native module methods with jest.fn(async () => {}) (in jest-expo/src/preset/setup.js:234-238), which resolves to undefined instead of a proper PermissionResponse object with a status field. There is no project-level mock for expo-location — no __mocks__/expo-location.ts, no jest.mock('expo-location') in jest/setup.ts, and no moduleNameMapper entry in jest.config.js.

    The data flow:

    1. Test triggers getCurrentPosition() → calls await requestForegroundPermissionsAsync() from expo-location
    2. expo-location delegates to native module ExpoLocation.requestForegroundPermissionsAsync()
    3. In tests, jest-expo replaces this with jest.fn(async () => {}) → resolves to undefined
    4. getCurrentPosition/index.ts:10 reads .status on undefined → TypeError

    Recommended Fix

    The most targeted fix would be one of:

    1. Add a project-level mock for expo-location in jest/setup.ts that returns a proper PermissionResponse:

      jest.mock('expo-location', () => ({
        ...jest.requireActual('expo-location'),
        requestForegroundPermissionsAsync: jest.fn(() =>
          Promise.resolve({ status: 'denied', granted: false, canAskAgain: true, expires: 0 })
        ),
      }));
    2. Add a defensive null check in getCurrentPosition/index.ts:10:

      if (!foregroundPermissionResponse || foregroundPermissionResponse.status !== PermissionStatus.GRANTED) {
    3. Mock getCurrentPosition directly in the test file if only that specific test needs it.


    Next Steps: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  4. tgolen commented on Mar 13, 2026

    @tgolen
    Contributor

    @MelvinBot implement suggestion 1

  5. MelvinBot commented on Mar 13, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #85257
    Please mark it as "Ready for review" when it is ready for review.

  6. melvin-bot commented on Mar 13, 2026

    @melvin-bot

    Triggered auto assignment to @rlinoz, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  7. ShridharGoel commented on Mar 13, 2026

    @ShridharGoel
    Contributor

    @tgolen Can you assign me here as the reviewer? Thanks

  8. 2 remaining items

  9. changed the title [-]Investigate workflow job failing on main: test / test (job 7)[/-] [+][Due for payment 2026-03-25] Investigate workflow job failing on main: test / test (job 7)[/+] on Mar 18, 2026
  10. melvin-bot commented on Mar 18, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  11. melvin-bot commented on Mar 18, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.39-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-03-25. 🎊

    For reference, here are some details about the assignees on this issue:

  12. melvin-bot commented on Mar 18, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  13. mallenexpensify commented on Mar 24, 2026

    @mallenexpensify
    Contributor

    @tgolen should this be $125 for the PR review, without any tests? Guessing so

  14. tgolen commented on Mar 25, 2026

    @tgolen
    Contributor

    Yes, I think that makes sense.

  15. mallenexpensify commented on Mar 25, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @ShridharGoel due $125 via NewDot

  16. JmillsExpensify commented on Apr 6, 2026

    @JmillsExpensify
    Contributor

    $125 approved for @ShridharGoel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions