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

Improve integration tests performance #350

Open
MrRefactoring opened this issue Jan 12, 2025 · 4 comments
Open

Improve integration tests performance #350

MrRefactoring opened this issue Jan 12, 2025 · 4 comments
Assignees
Labels
enhancement Denotes a suggestion or request aimed at improving or adding new features to the project. good first issue Highlights beginner-friendly tasks, ideal for those looking to contribute for the first time.
Milestone

Comments

@MrRefactoring
Copy link
Owner

MrRefactoring commented Jan 12, 2025

Currently, each test file (or group of tests) uses beforeAll and afterAll hooks to create and delete a project, respectively. This approach is redundant and negatively impacts test performance.

The objective is to refactor the test setup so that the project is created only once at the beginning of the tests and deleted after all tests finish (regardless of success or failure).

Checklist:

  1. Remove tests.setupFiles

    • Open the vitest.config.mts file.
    • Remove the tests.setupFiles property.
  2. Add tests.globalSetup

    • In vitest.config.mts, add a tests.globalSetup property pointing to a configuration file.
    • Ensure the file runs only for integration tests by checking process.env.TEST_ENV === 'integration'.
    • Update package.json -> scripts -> test:integration to set this flag.
  3. Create a Global Setup File

    • Use the following template for the configuration file:

      export async function setup() {
        // TODO: Implement project creation
      }
      
      export async function teardown() {
        // TODO: Implement project deletion
      }
  4. Clean Up Test Files

    • Remove beforeAll and afterAll hooks from test files where they are no longer needed.

Notes:
Submit a pull request to the release/v5.0.0 branch.

@MrRefactoring MrRefactoring added enhancement Denotes a suggestion or request aimed at improving or adding new features to the project. good first issue Highlights beginner-friendly tasks, ideal for those looking to contribute for the first time. labels Jan 12, 2025
@MrRefactoring MrRefactoring added this to the v5.0.0 milestone Jan 12, 2025
@tamirazrab
Copy link

/attempt Interesting.

@tamirazrab
Copy link

Hi @MrRefactoring , I'm facing couple of blockers, is there any Slack/Discord for me to get some help?

@MrRefactoring
Copy link
Owner Author

Hi @tamirazrab! You can message me on Telegram or email me

@tamirazrab
Copy link

Hi @tamirazrab! You can message me on Telegram or email me

Hi, Telegram doesn't work in my country and email won't be good for back and forth communication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Denotes a suggestion or request aimed at improving or adding new features to the project. good first issue Highlights beginner-friendly tasks, ideal for those looking to contribute for the first time.
Projects
None yet
Development

No branches or pull requests

2 participants