Skip to content

[FEATURE] Configurable output folder #569

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

Open
100terres opened this issue Mar 27, 2025 · 3 comments
Open

[FEATURE] Configurable output folder #569

100terres opened this issue Mar 27, 2025 · 3 comments

Comments

@100terres
Copy link

100terres commented Mar 27, 2025

Is your feature request related to a problem? Please describe.

We are configuring reassure in a monorepo containing many packages. We configured it in multiple packages. Each package has its own particularities and jest configuration, meaning they each have their respective reassure command.

We run these commands from the root of our monorepo. The problem is that since there's no way to configure an output folder, each package competes with the same .reassure/ folder at the root, making it difficult to run reassure across packages.

Let's say we change a shared util and want to measure its impact across the monorepo. We can't run the baseline, make the change, and then compare because the files in the .reassure/ folder get overridden after each reassure run in the different packages.

Describe the solution you'd like

Adding an environment variable called REASSURE_OUTPUT_FOLDER that works on the cli command and the measure packages.

The cli change might be as simple as changing a few lines here:

export const RESULTS_DIRECTORY = '.reassure';
export const RESULTS_FILE = '.reassure/current.perf';
export const BASELINE_FILE = '.reassure/baseline.perf';

to something like

 export const RESULTS_DIRECTORY = process.env.REASSURE_OUTPUT_FOLDER || '.reassure'; 
 export const RESULTS_FILE = `${RESULTS_DIRECTORY}/current.perf`; 
 export const BASELINE_FILE = `${RESULTS_DIRECTORY}/baseline.perf`;

For the measure package, it might conflict with the REASSURE_OUTPUT_FILE environment variable, requiring more refactoring.

outputFile: process.env.REASSURE_OUTPUT_FILE ?? '.reassure/current.perf',

Describe alternatives you've considered

We could also double down on the REASSURE_OUTPUT_FILE environment variable and make it work with the cli package.

Additional context

Such a configuration would allow us to set up a different output folder per package in our monorepo.


There might already be a way of doing this, but I couldn't find it. Let me know what you think and how I can help. I can even make a pull request if needed.

@mdjastrzebski
Copy link
Member

@100terres could you submit PR for this?

@100terres
Copy link
Author

@mdjastrzebski I can definitely look into it! Do you have a preferred way of approaching this?

@mdjastrzebski
Copy link
Member

mdjastrzebski commented Apr 18, 2025

The way you described in the issue (env variable) seems fine: REASSURE_OUTPUT_DIR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants