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

fix: cleanup and fix the test-export.sh #2425

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ run-all-examples = { cmd = "python tests/scripts/run-all-examples.py --pixi-exec
] }
test = "cargo nextest run --workspace"
test-all-fast = { depends-on = ["test", "test-integration-fast"] }
test-export = "python tests/scripts/test-export.sh"
test-workspace = """cargo nextest run --workspace --retries 2 --features slow_integration_tests
--status-level skip --failure-output immediate-final --no-fail-fast --final-status-level slow"""

Expand Down Expand Up @@ -135,6 +134,10 @@ python-build = ">=1.2.2,<2"
[feature.pypi-gen.tasks]
pypi-gen-indexes = "python tests/data/pypi-indexes/generate-indexes.py"

[feature.micromamba]
dependencies = { micromamba = "*" }
tasks = { test-export = "bash tests/scripts/test-export.sh" }

[environments]
default = { features = [
"build",
Expand All @@ -154,3 +157,4 @@ schema = { features = [
"schema",
"pytest",
], no-default-feature = true, solve-group = "default" }
test-export = { features = ["micromamba"], no-default-feature = true }
2 changes: 1 addition & 1 deletion src/cli/project/export/conda_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ mod tests {
#[test]
fn test_export_conda_env_yaml() {
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("src/cli/project/export/test-data/testenv/pixi.toml");
.join("tests/data/mock-projects/test-project-export/pixi.toml");
let project = Project::from_path(&path).unwrap();
let args = Args {
output_path: None,
Expand Down
2 changes: 1 addition & 1 deletion src/cli/project/export/conda_explicit_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ mod tests {
#[test]
fn test_render_conda_explicit_spec() {
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("src/cli/project/export/test-data/testenv/pixi.lock");
.join("tests/data/mock-projects/test-project-export/pixi.lock");
let lockfile = LockFile::from_path(&path).unwrap();

let output_dir = tempdir().unwrap();
Expand Down
7 changes: 5 additions & 2 deletions tests/scripts/test-export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ set -e
set -x
echo "Running test_export.sh"

echo "Activating 'export-test' env"
eval "$(pixi shell-hook)"
unset PIXI_IN_SHELL
echo "Exporting the export test environment"
cd src/cli/project/export/test-data/testenv
cd tests/data/mock-projects/test-project-export
pixi project export conda-environment | tee test-env.yml
echo "Creating the export test environment with micromamba"
micromamba create -y -f test-env.yml -n export-test
micromamba env list
micromamba env remove -y -n export-test
rm test-env.yml
cd ../../../../../..
cd ../../../..

# Setuptools error with env_test_package
# echo "Exporting an environment.yml with pip extras"
Expand Down
Loading