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

test: add E2E tests for plugin dependencies #2109

Merged
merged 1 commit into from
May 14, 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
36 changes: 36 additions & 0 deletions e2e/forge/test_pipx_deep_dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# shellcheck shell=bash disable=SC2016,SC2034

# Create system "tools" that always fail and push them to the front of PATH
cat >"$HOME/bin/fail" <<'EOF'
#!/usr/bin/env bash
echo "CALL TO SYSTEM $(basename $0)! args: $*" >&2
exit 1
EOF
chmod +x "$HOME"/bin/fail
for TOOL in python python3 pipx; do
ln -s fail "$HOME/bin/$TOOL"
done
export PATH="$HOME/bin:$PATH"

# Just to be sure...
assert_fail "python"
assert_fail "python3"
assert_fail "pipx"

# Use only precompiled python
export MISE_PYTHON_COMPILE=0

# Set up a 3-step installation: [email protected] > [email protected] > pipx:[email protected]
cat >.mise.toml <<EOF
[tools]
python = "3.12.3"
pipx = "1.5.0"
"pipx:mkdocs" = "1.6.0"
EOF

# Install the tools
mise install

# Assert that mkdocs 1.6.0 has been installed with pipx and uses python 3.12
# (mkdocs conveniently returns its installation path in with --version)
assert_contains "mise x -- mkdocs --version" "/mise/installs/pipx-mkdocs/1.6.0/venvs/mkdocs/lib/python3.12/"
31 changes: 31 additions & 0 deletions e2e/forge/test_pipx_direct_dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# shellcheck shell=bash
require_cmd "python"

# Create a system pipx that always fail and push it to the front of PATH
cat >"$HOME/bin/pipx" <<'EOF'
#!/usr/bin/env bash
echo "CALL TO SYSTEM pipx! args: $*" >&2
exit 1
EOF
chmod +x "$HOME"/bin/pipx
export PATH="$HOME/bin:$PATH"

# Just to be sure...
assert_fail "pipx"

# Use precompiled python
export MISE_PYTHON_COMPILE=0

# Set up a 2-step installation: [email protected] > pipx:[email protected]
cat >.mise.toml <<EOF
[tools]
pipx = "1.5.0"
"pipx:mkdocs" = "1.6.0"
EOF

# Install the tools
mise install

# Assert that mkdocs 1.6.0 has been installed with pipx
# (mkdocs conveniently returns its installation path in with --version)
assert_contains "mise x -- mkdocs --version" "/mise/installs/pipx-mkdocs/1.6.0/"
Loading