Skip to content
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

Optimizing Workflow and Rspec Test Suite #5720

Open
prathamVaidya opened this issue Mar 23, 2024 · 0 comments
Open

Optimizing Workflow and Rspec Test Suite #5720

prathamVaidya opened this issue Mar 23, 2024 · 0 comments
Labels

Comments

@prathamVaidya
Copy link
Contributor

prathamVaidya commented Mar 23, 2024

What is happening?

The ci.yml workflow file for Continuous Integration (CI) serves the purpose of executing tests and identifying linting errors. Currently, this workflow typically consumes approximately 35 minutes to execute. An average of 30 minutes is used by the RSpec test suite. We can perform multiple optimizations on the workflow and rspec test suite to reduce this time and improve the overall development process.

Possible Workflow Optimizations:

1. Separate workflow steps depending on file changes

There is no need to run RSpec tests if only a javascript file or some .md file has changed. We can filter the steps based on file changes using dorny/paths-filter@v3 workflow action. I have opened a PR for this.

2. Running Steps Concurrently

While executing parallel steps is not supported by Github, a custom script can be written to run some steps parallel to reduce workflow time. Refer to this Discussion

Possible RSpec Optimizations:

These are time-consuming but can be slowly started

  • Separate Unit Tests and Integration Tests. Write logic to run UTs on every push, pull_request, and Integration Tests less often.
  • Use Mock instead of db call
  • try reducing time for the top slowest tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant