Skip to content

Support subdirectory projects other than test #116

@ReubenJ

Description

@ReubenJ

I'm setting up benchmarks for a package, and I'm using some benchmark-only dependencies. The setup is the same as the test setup supported by TestEnv, with test-only dependencies in test/Project.toml. I'd like to be able to activate an environment from benchmark/Project.toml with the current package under development layered on top.

I think this is as simple as adding a keyword argument to activate to specify which subdirectory to target. Currently, the subdirectory is hardcoded to "test":

return sandbox(ctx, pkgspec, joinpath(path, "test"), test_project_override; allow_reresolve) do

sandbox_path = joinpath(pkgspec.path::String, "test")

base_path = test_dir_has_project_file(temp_ctx, pkgspec) ? joinpath(pkgspec.path, "test") : pkgspec.path

Adding a keyword argument to activate, such as subdir, should be enough to support this functionality without introducing any breaking changes, so long as it defaults to "test". I gave this a try (be9279a), and it seems to work as I'd expect.

A couple of questions:

  • Is this within the scope of TestEnv?
  • Is the change above enough to support the functionality I'm describing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions