You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
⚠️ 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 ⚠️
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
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.
Activity
melvin-bot commentedon Jul 15, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (
External)melvin-bot commentedon Jul 15, 2024
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.melvin-bot commentedon Jul 15, 2024
melvin-bot commentedon Jul 15, 2024
Triggered auto assignment to Design team member for new feature review - @dubielzyk-expensify (
NewFeature)roryabraham commentedon Jul 15, 2024
There's not really a good GH project to associate this one with, and we won't need any design help.
roryabraham commentedon Jul 17, 2024
Kind of looks like the Upwork automation didn't work for this one
lschurr commentedon Jul 17, 2024
Looking at the PR, there aren't any contributors that need payment right @roryabraham? Can we close since the PR is merged?
roryabraham commentedon Jul 17, 2024
We're still waiting on proposals for this one. I didn't have a PR for this one
roryabraham commentedon Jul 17, 2024
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
AndrewGable commentedon Jul 22, 2024
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.
roryabraham commentedon Jul 23, 2024
ok, going to close this one as not planned then. Probably pretty low ROI if you aren't sold on the problem