Closed prathamVaidya closed 6 months ago
Many of the ruby tests are browser-based feature specs, which test against both the JS frontend and the Ruby backend. I prefer to just run the entire test suite for every change, except perhaps changes that are exclusively to docs.
Oh I missed that point completely. I was really thinking why such an obvious optimization has not been done and now I know why. Anyways do you want me to close this PR or update this for docs only?
Let's close it, thanks.
What this PR does
Fixes #5720
This is an optimization on the CI workflow
ci.yml
. By filtering some steps based on file changes we can reduce the workflow execution time.For Example: If only a javascript file is changed then there is no need to run Ruby tests.
Changes
Current
file-filters.yml
contents are:Here a backend filter is defined. The codebase has ruby files everywhere so I have defined the backend is everything other than frontend code,
.github
andtraining_content
. The more definite this list will be the better it is. Let me know any other paths that needed to be defined here. (One can be all the markdowns*.md
)Ruby tests that took 30 mins will be skipped on all these folders. I have taken inspiration from how sentry repository used this.
I have tested the workflow on my fork at this branch.
Here are some examples of successful workflows:
On Push -> https://github.com/prathamVaidya/WikiEduDashboard/actions/runs/8403231749 On Pull Request -> https://github.com/prathamVaidya/WikiEduDashboard/actions/runs/8403275731 (It failed because it ran flaky RSpecs which it should have because there was a modified ruby file)
@ragesoss Let me know if there is a breaking change associated with this feature. Especially on my assumption that the files in
training_content
,app/assets
do not affect the ruby tests.