Skip to content

Commit

Permalink
Fix install conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Aug 22, 2023
1 parent 9fac0f8 commit faca44b
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 2 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description = "Sample crate"
name = "crate1"
version = "1.0.0"
licenses = []
maintainers = ["[email protected]"]
maintainers-logins = ["someone"]

[origin."case(os)"."..."]
url = "file:../../../crates/crate/crate1.tgz"
hashes = ["sha256:d35efed8325f646652f533fa4094d580cf28bccc9cc1d85751738b446bbed37a"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description = "Sample crate"
name = "crate2"
version = "1.0.0"
licenses = []
maintainers = ["[email protected]"]
maintainers-logins = ["someone"]

[origin."case(os)"."..."]
url = "file:../../../crates/crate/crate2.tgz"
hashes = ["sha256:8a814f2f0683b3b4db10a1c1e08e951d81de0deff2fa0f70a29295e45184b795"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "1.2"
23 changes: 23 additions & 0 deletions testsuite/tests/install/independent/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Test installation of two independent crates with `alr install` to verify that
our deployment system doesn't introduce any conflicts.
"""

from drivers.alr import run_alr, init_local_crate
from drivers.asserts import assert_eq, assert_match, assert_installed
from subprocess import run

import os


PREFIX=os.path.join(os.getcwd(), "install")
PREFIX_ARG=f"--prefix={PREFIX}"

# Install both crates one after the other, shouldn't fail
run_alr("install", PREFIX_ARG, "crate1")
run_alr("install", PREFIX_ARG, "crate2")

# Check contents of the prefix
assert_installed(PREFIX, ["crate1=1.0.0", "crate2=1.0.0"])

print('SUCCESS')
4 changes: 4 additions & 0 deletions testsuite/tests/install/independent/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
driver: python-script
indexes:
my_index:
in_fixtures: false
Binary file modified testsuite/tests/install/softlinks/my_index/crate-0.1.0.tgz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ executables=['main']

[origin.'case(os)'.'...']
url = "file:../../../crate-0.1.0.tgz"
hashes = ["sha256:35cc9636468031e1874fe142a6f40557d3befc6dd26cdded0401f440534f4bd6"]
hashes = ["sha256:73d1455dd4b49ea598faa939557c15046db6c689552db03fd6a49c57d3cbc1b2"]
13 changes: 12 additions & 1 deletion testsuite/tests/install/softlinks/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
"""
Test that binary files containing softlinks can be installed properly
Test that binary files containing softlinks can be installed properly. The test
crate contains all kinds of pernicious links (broken, recursive, etc.):
crate
├── bin -> subdir/bin
├── broken -> missing
└── subdir
├── bin
│ ├── loop -> ../../subdir
│ └── x
├── parent -> ..
└── self -> ../subdir
"""

import sys
Expand Down

0 comments on commit faca44b

Please sign in to comment.