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

Possibility of overriding the default test directory location on Windows #1204

Open
Krande opened this issue Nov 19, 2024 · 4 comments
Open

Comments

@Krande
Copy link

Krande commented Nov 19, 2024

Hey,

I was wondering if it's possible to control the location of the test directory.

From what I can tell, setting the --output-dir sets the parent directory for all build-related environments and work directories.
Image

As shown in the figure below, the work directory and build_env/host_env environments are present underneath the --output-dir/bld/<package-name-id>
Image

But for some reason only the test environment is located under the --output-dir/bld/<package-name-id>/work
Image

And the tests are moved to a local temporary directory %AppData%\\Local\\Temp\\.tmpAUNvtX\\conda_build_script.py.

In certain windows enterprise configurations, the user might not have the privileges to run code inside %APPDATA%. So I was wondering if it's possible to get more fine-grained control over the test directory location?

Let me know if you need more information to make sense of my request :)

Best Regards
Kristoffer

@Krande Krande changed the title Possibility of controlling the test environment directory on Windows Possibility of controlling the test directory on Windows Nov 19, 2024
@Krande Krande changed the title Possibility of controlling the test directory on Windows Possibility of overriding the default test directory location on Windows Nov 19, 2024
@wolfv
Copy link
Member

wolfv commented Nov 19, 2024

That is indeed something I didn't know / consider before. We can definitely come up with a way to configuring it.

@wolfv
Copy link
Member

wolfv commented Nov 19, 2024

Suggestions / PRs very welcome! :)

@Krande
Copy link
Author

Krande commented Nov 19, 2024

@wolfv I can give it a shot. I guess it boils down to how we'd like to manipulate tmp_dir in https://github.com/prefix-dev/rattler-build/blob/main/src/package_test/run_test.rs#L118 either through using a env var passed as a flag to the cli.

Update:
Or maybe its this tmp_dir? https://github.com/prefix-dev/rattler-build/blob/main/src/package_test/run_test.rs#L564

@Krande
Copy link
Author

Krande commented Nov 19, 2024

@wolfv so I made some extremely ugly hacks that at least managed to move the test directory to a subdirectory inside --output-dir in main...Krande:rattler-build:fix/windows-test-directory.

I'll try to find time between other responsibilities to look into this. But if you see any immediate opportunities based on this, feel free to take a stab at it. I can also make a PR with what I have if that's a more convenient place to continue to the conversation :)

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