Skip to content

Dynamic workflow mocks #45413

Closed as not planned
Closed as not planned

Description

@roryabraham

Problem

Our GitHub workflow mocks, such as workflow_tests/mocks/platformDeployMocks.ts are statically written and updated (manually, by developers). Generally most of our team doesn't really know how these tests work, and while they're helpful, having to manually update the mocks to match the workflow files is inefficient and comes with a substantial amount of overhead.

Solution

Update our workflow tests such that the workflow mocks are dynamically generated from the workflow yaml file at the start of the test run, and optionally cleaned up afterwards. There is some existing code to generate boilerplate in workflow_tests/utils/preGenerateTest.ts that can serve as a starting point.

The goal of this issue would be that everything in workflow_tests/mocks would no longer be committed, but would be:

  • Generated at runtime when you start each test
  • (ideally) cached such that they're only re-generated if the workflow file being mocked changes
Issue OwnerCurrent Issue Owner: @Pujan92

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    NewFeatureSomething to build that is a new item.
    on Jul 15, 2024
  2. self-assigned this
    on Jul 15, 2024
  3. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 15, 2024
  4. melvin-bot commented on Jul 15, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (External)

  5. melvin-bot commented on Jul 15, 2024

    @melvin-bot

    Triggered auto assignment to @lschurr (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

  6. melvin-bot commented on Jul 15, 2024

    @melvin-bot

    ⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

  7. melvin-bot commented on Jul 15, 2024

    @melvin-bot

    Triggered auto assignment to Design team member for new feature review - @dubielzyk-expensify (NewFeature)

  8. roryabraham commented on Jul 15, 2024

    @roryabraham
    ContributorAuthor

    There's not really a good GH project to associate this one with, and we won't need any design help.

  9. roryabraham commented on Jul 17, 2024

    @roryabraham
    ContributorAuthor

    Kind of looks like the Upwork automation didn't work for this one

  10. lschurr commented on Jul 17, 2024

    @lschurr
    Contributor

    Looking at the PR, there aren't any contributors that need payment right @roryabraham? Can we close since the PR is merged?

  11. roryabraham commented on Jul 17, 2024

    @roryabraham
    ContributorAuthor

    We're still waiting on proposals for this one. I didn't have a PR for this one

  12. roryabraham commented on Jul 17, 2024

    @roryabraham
    ContributorAuthor

    It's actually kind of tricky to do to, since sometimes we need to tweak the mocks. And the TS functions need to be generated from YAML. Not entirely sure how the type-checking will work for that...

    I wonder if the original SWM author is available to iterate on and improve these tests. cc @AndrewGable

  13. AndrewGable commented on Jul 22, 2024

    @AndrewGable
    Contributor

    Not sure I agree with the problem, it did take me a while to get up to speed on the mocks, but I think a dynamic mock generator will be much harder to debug than static mocks.

  14. roryabraham commented on Jul 23, 2024

    @roryabraham
    ContributorAuthor

    ok, going to close this one as not planned then. Probably pretty low ROI if you aren't sold on the problem

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

Metadata

Metadata

Labels

ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsNewFeatureSomething to build that is a new item.WeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions