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

Running Only Modified Feature Tests and Their Dependencies #26926

Open
abhayraj-yadav-st4 opened this issue Nov 19, 2024 · 0 comments
Open

Running Only Modified Feature Tests and Their Dependencies #26926

abhayraj-yadav-st4 opened this issue Nov 19, 2024 · 0 comments
Labels
suggestion suggestions for new features (yet to be agreed)

Comments

@abhayraj-yadav-st4
Copy link

abhayraj-yadav-st4 commented Nov 19, 2024

Hello everyone,

I'm working on a Deno project and using BDD for testing. The project is structured with each feature and its slices in separate folders, each containing their own code and test cases.

The Issue

I recently updated a feature called "User Profile Management", which is a dependency for another feature, "Authentication". When I run deno test, it executes all the tests in the project, including unrelated ones like "Payment Processing", which takes a lot of time.

What I'm Looking For:

I want to run only the test cases for the User Profile Management feature and its dependents (like Authentication) after making changes. This way, I can save time and focus on relevant tests.

Attempts So Far:

  • Running Specific Tests: I tried deno test src/user_profile/, but it doesn't include tests from Authentication.
  • Manual Selection: Specifying multiple test files manually isn't practical as dependencies grow.

Project Structure Example:

src/
├── authentication/
│   ├── auth.ts (imports ../user_profile/profile.ts)
│   └── auth_test.ts
├── user_profile/
│   ├── profile.ts 
│   └── profile_test.ts
├── payment_processing/
│   ├── payment.ts
│   └── payment_test.ts

Goal

  • After changing profile.ts, I want to run profile_test.ts and auth_test.ts.
  • Avoid running unrelated tests like payment_test.ts.

Why It Matters

  • Efficiency: Saves time during development.
  • Focus: Helps concentrate on affected code areas.
  • Scalability: Important as the project grows.

Proposed Enhancements

  1. Auto-Run Affected Tests Based on Changes:

    • Introduce a flag (e.g., --affected) that detects code modifications and automatically executes only the relevant tests, including those from dependent features. This would streamline the workflow by saving time and focusing on necessary tests.
  2. CLI Integration for Including Dependent Tests:

    • Enhance the deno test command with a configuration option (e.g., --include-dependencies) to run tests for a modified feature along with its dependencies. This would improve testing efficiency by ensuring related tests are executed without manual selection.
@abhayraj-yadav-st4 abhayraj-yadav-st4 changed the title Running Only Modified Feature Tests and Their Dependencies in Deno with BDD Running Only Modified Feature Tests and Their Dependencies Nov 19, 2024
@bartlomieju bartlomieju added the suggestion suggestions for new features (yet to be agreed) label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

No branches or pull requests

2 participants