Skip to content

Tests: suppress the OPENFN_REPO_DIR env var warning #846

Description

@josephjclark

The CLI tests don't set the OPENFN_REPO_DIR env var

That means that each test logs a warning:

WARNING: no repo module dir found! Using the default (/tmp/repo)
packages/cli test: You should set OPENFN_REPO_DIR or pass --repoDir=some/path in to the CLI

This happens before the CLI has created a logger, so we can't put a mock logger here to test or suppress this is message. And while this logging doesn't actually matter, it is pretty annoying.

Options:

  1. Force the env var value in unit tests. Not unreasonable. We should set to the default value though.
  2. Add an option somewhere to supress this warning, like --no-warnings
  3. Remove the warning. Is it really necessary? Well maybe, I'm not wild about the tmp dir being used for the repo, and would prefer users set a sensible location on their machine

Metadata

Metadata

Assignees

No one assigned

    Labels

    DevXgood first issueGood for newcomerstech debtNon-critical, invisible code issues that ought to be addressed

    Type

    No type

    Projects

    Status
    Tech Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions