Skip to content

[FEATURE] Configurable output folder #569

Open

Description

@100terres

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.

Activity

  1. mdjastrzebski commented on Mar 29, 2025

    @mdjastrzebski
    Member

    @100terres could you submit PR for this?

  2. 100terres commented on Mar 31, 2025

    @100terres
    Author

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

  3. mdjastrzebski commented on Apr 18, 2025

    @mdjastrzebski
    Member

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

  4. huytdps13400 commented on Aug 22, 2026

    @huytdps13400

    A fix is now open in #592.

    REASSURE_OUTPUT_DIR is applied across the CLI, measure defaults, and comparison outputs so baseline.perf, current.perf, output.json, and output.md stay together in the configured package-specific directory. An explicit REASSURE_OUTPUT_FILE still takes precedence for measurement output.

    The PR includes red/green tests, documentation, and a changeset. yarn validate and yarn build pass, and an end-to-end CLI probe created all four files under the custom directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions