Replace magic test port 12110 with 0 (#345)
Also introduce constants for some test package SHAs to make them easier to update.
This commit is contained in:
1 parent
2aa60eaf1f
commit
dfe85b786e
123 files changed
+469
-469
No files matched your search
+1
-1
@@ -2,6 +2,6 @@ amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
@@ -1132,7 +1132,7 @@ result = someLib.x
|
||||
writePklFile(
|
||||
"test.pkl",
|
||||
"""
|
||||
import "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
import "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
|
||||
res = Swallow
|
||||
"""
|
||||
@@ -1212,7 +1212,7 @@ result = someLib.x
|
||||
writePklFile(
|
||||
"test.pkl",
|
||||
"""
|
||||
import "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
import "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
|
||||
res = Swallow
|
||||
"""
|
||||
|
||||
@@ -49,19 +49,19 @@ class CliPackageDownloaderTest {
|
||||
),
|
||||
packageUris =
|
||||
listOf(
|
||||
PackageUri("package://localhost:12110/birds@0.5.0"),
|
||||
PackageUri("package://localhost:12110/fruit@1.0.5"),
|
||||
PackageUri("package://localhost:12110/fruit@1.1.0")
|
||||
PackageUri("package://localhost:0/birds@0.5.0"),
|
||||
PackageUri("package://localhost:0/fruit@1.0.5"),
|
||||
PackageUri("package://localhost:0/fruit@1.1.0")
|
||||
),
|
||||
noTransitive = true
|
||||
)
|
||||
cmd.run()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.json")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.0.5/fruit@1.0.5.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.0.5/fruit@1.0.5.json")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.1.0/fruit@1.1.0.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.1.0/fruit@1.1.0.json")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/birds@0.5.0/birds@0.5.0.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/birds@0.5.0/birds@0.5.0.json")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/fruit@1.0.5/fruit@1.0.5.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/fruit@1.0.5/fruit@1.0.5.json")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/fruit@1.1.0/fruit@1.1.0.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/fruit@1.1.0/fruit@1.1.0.json")).exists()
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -86,13 +86,13 @@ class CliPackageDownloaderTest {
|
||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||
testPort = server.port
|
||||
),
|
||||
packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")),
|
||||
packageUris = listOf(PackageUri("package://localhost:0/birds@0.5.0")),
|
||||
noTransitive = true
|
||||
)
|
||||
cmd.run()
|
||||
assertThat(tempDir.resolve(".my-cache/package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip"))
|
||||
assertThat(tempDir.resolve(".my-cache/package-1/localhost:0/birds@0.5.0/birds@0.5.0.zip"))
|
||||
.exists()
|
||||
assertThat(tempDir.resolve(".my-cache/package-1/localhost:12110/birds@0.5.0/birds@0.5.0.json"))
|
||||
assertThat(tempDir.resolve(".my-cache/package-1/localhost:0/birds@0.5.0/birds@0.5.0.json"))
|
||||
.exists()
|
||||
}
|
||||
|
||||
@@ -108,15 +108,13 @@ class CliPackageDownloaderTest {
|
||||
),
|
||||
packageUris =
|
||||
listOf(
|
||||
PackageUri(
|
||||
"package://localhost:12110/birds@0.5.0::sha256:0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
),
|
||||
PackageUri("package://localhost:0/birds@0.5.0::sha256:${PackageServer.BIRDS_SHA}"),
|
||||
),
|
||||
noTransitive = true
|
||||
)
|
||||
cmd.run()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.json")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/birds@0.5.0/birds@0.5.0.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/birds@0.5.0/birds@0.5.0.json")).exists()
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -131,18 +129,18 @@ class CliPackageDownloaderTest {
|
||||
),
|
||||
packageUris =
|
||||
listOf(
|
||||
PackageUri("package://localhost:12110/birds@0.5.0::sha256:intentionallyBogusChecksum"),
|
||||
PackageUri("package://localhost:0/birds@0.5.0::sha256:intentionallyBogusChecksum"),
|
||||
),
|
||||
noTransitive = true
|
||||
)
|
||||
assertThatCode { cmd.run() }
|
||||
.hasMessage(
|
||||
"""
|
||||
Cannot download package `package://localhost:12110/birds@0.5.0` because the computed checksum for package metadata does not match the expected checksum.
|
||||
Cannot download package `package://localhost:0/birds@0.5.0` because the computed checksum for package metadata does not match the expected checksum.
|
||||
|
||||
Computed checksum: "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
Computed checksum: "${PackageServer.BIRDS_SHA}"
|
||||
Expected checksum: "intentionallyBogusChecksum"
|
||||
Asset URL: "https://localhost:12110/birds@0.5.0"
|
||||
Asset URL: "https://localhost:0/birds@0.5.0"
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
@@ -153,7 +151,7 @@ class CliPackageDownloaderTest {
|
||||
val cmd =
|
||||
CliPackageDownloader(
|
||||
baseOptions = CliBaseOptions(workingDir = tempDir, noCache = true),
|
||||
packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")),
|
||||
packageUris = listOf(PackageUri("package://localhost:0/birds@0.5.0")),
|
||||
noTransitive = true
|
||||
)
|
||||
assertThatCode { cmd.run() }
|
||||
@@ -170,12 +168,12 @@ class CliPackageDownloaderTest {
|
||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||
testPort = server.port
|
||||
),
|
||||
packageUris = listOf(PackageUri("package://localhost:12110/badChecksum@1.0.0")),
|
||||
packageUris = listOf(PackageUri("package://localhost:0/badChecksum@1.0.0")),
|
||||
noTransitive = true
|
||||
)
|
||||
assertThatCode { cmd.run() }
|
||||
.hasMessageStartingWith(
|
||||
"Cannot download package `package://localhost:12110/badChecksum@1.0.0` because the computed checksum does not match the expected checksum."
|
||||
"Cannot download package `package://localhost:0/badChecksum@1.0.0` because the computed checksum does not match the expected checksum."
|
||||
)
|
||||
}
|
||||
|
||||
@@ -191,7 +189,7 @@ class CliPackageDownloaderTest {
|
||||
),
|
||||
packageUris =
|
||||
listOf(
|
||||
PackageUri("package://localhost:12110/badChecksum@1.0.0"),
|
||||
PackageUri("package://localhost:0/badChecksum@1.0.0"),
|
||||
PackageUri("package://bogus.domain/notAPackage@1.0.0")
|
||||
),
|
||||
noTransitive = true
|
||||
@@ -201,12 +199,12 @@ class CliPackageDownloaderTest {
|
||||
"""
|
||||
Failed to download some packages.
|
||||
|
||||
Failed to download package://localhost:12110/badChecksum@1.0.0 because:
|
||||
Cannot download package `package://localhost:12110/badChecksum@1.0.0` because the computed checksum does not match the expected checksum.
|
||||
Failed to download package://localhost:0/badChecksum@1.0.0 because:
|
||||
Cannot download package `package://localhost:0/badChecksum@1.0.0` because the computed checksum does not match the expected checksum.
|
||||
|
||||
Computed checksum: "a6bf858cdd1c09da475c2abe50525902580910ee5cc1ff624999170591bf8f69"
|
||||
Expected checksum: "intentionally bogus checksum"
|
||||
Asset URL: "https://localhost:12110/badChecksum@1.0.0/badChecksum@1.0.0.zip"
|
||||
Asset URL: "https://localhost:0/badChecksum@1.0.0/badChecksum@1.0.0.zip"
|
||||
|
||||
Failed to download package://bogus.domain/notAPackage@1.0.0 because:
|
||||
Exception when making request `GET https://bogus.domain/notAPackage@1.0.0`:
|
||||
@@ -226,13 +224,13 @@ class CliPackageDownloaderTest {
|
||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||
testPort = server.port
|
||||
),
|
||||
packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")),
|
||||
packageUris = listOf(PackageUri("package://localhost:0/birds@0.5.0")),
|
||||
noTransitive = false
|
||||
)
|
||||
.run()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.json")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.0.5/fruit@1.0.5.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:12110/fruit@1.0.5/fruit@1.0.5.json")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/birds@0.5.0/birds@0.5.0.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/birds@0.5.0/birds@0.5.0.json")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/fruit@1.0.5/fruit@1.0.5.zip")).exists()
|
||||
assertThat(tempDir.resolve("package-1/localhost:0/fruit@1.0.5/fruit@1.0.5.json")).exists()
|
||||
}
|
||||
}
|
||||
@@ -224,7 +224,7 @@ class CliProjectPackagerTest {
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -237,18 +237,18 @@ class CliProjectPackagerTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "04eec465b217fb9779489525d26e9b587e5e47ff4d584c7673a450109715bc31"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -433,7 +433,7 @@ class CliProjectPackagerTest {
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
["project2"] = import("../project2/PklProject")
|
||||
}
|
||||
@@ -446,16 +446,16 @@ class CliProjectPackagerTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/project2@5": {
|
||||
"package://localhost:0/project2@5": {
|
||||
"type": "local",
|
||||
"uri": "projectpackage://localhost:12110/project2@5.0.0",
|
||||
"uri": "projectpackage://localhost:0/project2@5.0.0",
|
||||
"path": "../project2"
|
||||
}
|
||||
}
|
||||
@@ -471,7 +471,7 @@ class CliProjectPackagerTest {
|
||||
|
||||
package {
|
||||
name = "project2"
|
||||
baseUri = "package://localhost:12110/project2"
|
||||
baseUri = "package://localhost:0/project2"
|
||||
version = "5.0.0"
|
||||
packageZipUrl = "https://foo.com/project2.zip"
|
||||
}
|
||||
@@ -513,15 +513,15 @@ class CliProjectPackagerTest {
|
||||
},
|
||||
"dependencies": {
|
||||
"birds": {
|
||||
"uri": "package://localhost:12110/birds@0.5.0",
|
||||
"uri": "package://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||
}
|
||||
},
|
||||
"project2": {
|
||||
"uri": "package://localhost:12110/project2@5.0.0",
|
||||
"uri": "package://localhost:0/project2@5.0.0",
|
||||
"checksums": {
|
||||
"sha256": "6f469b28f8b62a8a1191e2749bcf9c27dedbbb1e0ea754ac34af57b534e0ddda"
|
||||
"sha256": "981787869571330b2f609a94a5912466990ce00e3fa94e7f290c2f99a6d5e5ed"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -537,7 +537,7 @@ class CliProjectPackagerTest {
|
||||
"""
|
||||
{
|
||||
"name": "project2",
|
||||
"packageUri": "package://localhost:12110/project2@5.0.0",
|
||||
"packageUri": "package://localhost:0/project2@5.0.0",
|
||||
"version": "5.0.0",
|
||||
"packageZipUrl": "https://foo.com/project2.zip",
|
||||
"packageZipChecksums": {
|
||||
@@ -571,7 +571,7 @@ class CliProjectPackagerTest {
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
["project2"] = import("../project2/PklProject")
|
||||
}
|
||||
@@ -584,16 +584,16 @@ class CliProjectPackagerTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/project2@5": {
|
||||
"package://localhost:0/project2@5": {
|
||||
"type": "local",
|
||||
"uri": "projectpackage://localhost:12110/project2@5.0.0",
|
||||
"uri": "projectpackage://localhost:0/project2@5.0.0",
|
||||
"path": "../project2"
|
||||
}
|
||||
}
|
||||
@@ -609,7 +609,7 @@ class CliProjectPackagerTest {
|
||||
|
||||
package {
|
||||
name = "project2"
|
||||
baseUri = "package://localhost:12110/project2"
|
||||
baseUri = "package://localhost:0/project2"
|
||||
version = "5.0.0"
|
||||
packageZipUrl = "https://foo.com/project2.zip"
|
||||
}
|
||||
@@ -884,14 +884,14 @@ class CliProjectPackagerTest {
|
||||
tempDir.writeFile("project/main.pkl", "res = 1")
|
||||
tempDir.writeFile(
|
||||
"project/PklProject",
|
||||
// intentionally conflict with localhost:12110/birds@0.5.0 from our test fixtures
|
||||
// intentionally conflict with localhost:0/birds@0.5.0 from our test fixtures
|
||||
"""
|
||||
amends "pkl:Project"
|
||||
|
||||
package {
|
||||
name = "birds"
|
||||
version = "0.5.0"
|
||||
baseUri = "package://localhost:12110/birds"
|
||||
baseUri = "package://localhost:0/birds"
|
||||
packageZipUrl = "https://foo.com"
|
||||
}
|
||||
"""
|
||||
@@ -916,10 +916,10 @@ class CliProjectPackagerTest {
|
||||
assertThat(e)
|
||||
.hasMessageStartingWith(
|
||||
"""
|
||||
Package `package://localhost:12110/birds@0.5.0` was already published with different contents.
|
||||
Package `package://localhost:0/birds@0.5.0` was already published with different contents.
|
||||
|
||||
Computed checksum: 04eec465b217fb9779489525d26e9b587e5e47ff4d584c7673a450109715bc31
|
||||
Published checksum: 0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453
|
||||
Computed checksum: aa8c883841db22e92794f4708b01dc905b5da77645b7dfb5b22a73da8c347db1
|
||||
Published checksum: ${PackageServer.BIRDS_SHA}
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
@@ -936,7 +936,7 @@ class CliProjectPackagerTest {
|
||||
package {
|
||||
name = "mangos"
|
||||
version = "1.0.0"
|
||||
baseUri = "package://localhost:12110/mangos"
|
||||
baseUri = "package://localhost:0/mangos"
|
||||
packageZipUrl = "https://foo.com"
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -73,7 +73,7 @@ class CliProjectResolverTest {
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -98,18 +98,18 @@ class CliProjectResolverTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ class CliProjectResolverTest {
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -153,18 +153,18 @@ class CliProjectResolverTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,7 +184,7 @@ class CliProjectResolverTest {
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
["project2"] = import("../project2/PklProject")
|
||||
}
|
||||
@@ -198,14 +198,14 @@ class CliProjectResolverTest {
|
||||
|
||||
package {
|
||||
name = "project2"
|
||||
baseUri = "package://localhost:12110/package2"
|
||||
baseUri = "package://localhost:0/package2"
|
||||
version = "5.0.0"
|
||||
packageZipUrl = "https://foo.com/package2.zip"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
["fruit"] {
|
||||
uri = "package://localhost:12110/fruit@1.0.5"
|
||||
uri = "package://localhost:0/fruit@1.0.5"
|
||||
}
|
||||
["project3"] = import("../project3/PklProject")
|
||||
}
|
||||
@@ -220,14 +220,14 @@ class CliProjectResolverTest {
|
||||
|
||||
package {
|
||||
name = "project3"
|
||||
baseUri = "package://localhost:12110/package3"
|
||||
baseUri = "package://localhost:0/package3"
|
||||
version = "5.0.0"
|
||||
packageZipUrl = "https://foo.com/package3.zip"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
["fruit"] {
|
||||
uri = "package://localhost:12110/fruit@1.1.0"
|
||||
uri = "package://localhost:0/fruit@1.1.0"
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -251,28 +251,28 @@ class CliProjectResolverTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "a82e92e0c259591111d09d18a14f5ad66e2b6e13d827ee3e6f7ce06f5d0fbe0c"
|
||||
"sha256": "${PackageServer.FRUIT_1_1_SHA}"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/package2@5": {
|
||||
"package://localhost:0/package2@5": {
|
||||
"type": "local",
|
||||
"uri": "projectpackage://localhost:12110/package2@5.0.0",
|
||||
"uri": "projectpackage://localhost:0/package2@5.0.0",
|
||||
"path": "../project2"
|
||||
},
|
||||
"package://localhost:12110/package3@5": {
|
||||
"package://localhost:0/package3@5": {
|
||||
"type": "local",
|
||||
"uri": "projectpackage://localhost:12110/package3@5.0.0",
|
||||
"uri": "projectpackage://localhost:0/package3@5.0.0",
|
||||
"path": "../project3"
|
||||
}
|
||||
}
|
||||
@@ -292,7 +292,7 @@ class CliProjectResolverTest {
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
["fruit"] = import("../fruit/PklProject")
|
||||
}
|
||||
@@ -306,7 +306,7 @@ class CliProjectResolverTest {
|
||||
|
||||
package {
|
||||
name = "fruit"
|
||||
baseUri = "package://localhost:12110/fruit"
|
||||
baseUri = "package://localhost:0/fruit"
|
||||
version = "1.0.0"
|
||||
packageZipUrl = "https://foo.com/fruit.zip"
|
||||
}
|
||||
@@ -333,18 +333,18 @@ class CliProjectResolverTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,7 +354,7 @@ class CliProjectResolverTest {
|
||||
)
|
||||
assertThat(errOut.toString())
|
||||
.isEqualTo(
|
||||
"WARN: local dependency `package://localhost:12110/fruit@1.0.0` was overridden to remote dependency `package://localhost:12110/fruit@1.0.5`.\n"
|
||||
"WARN: local dependency `package://localhost:0/fruit@1.0.0` was overridden to remote dependency `package://localhost:0/fruit@1.0.5`.\n"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ class CliProjectResolverTest {
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -381,7 +381,7 @@ class CliProjectResolverTest {
|
||||
|
||||
dependencies {
|
||||
["fruit"] {
|
||||
uri = "package://localhost:12110/fruit@1.1.0"
|
||||
uri = "package://localhost:0/fruit@1.1.0"
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -416,18 +416,18 @@ class CliProjectResolverTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
"sha256": "${PackageServer.FRUIT_SHA}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -441,11 +441,11 @@ class CliProjectResolverTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "a82e92e0c259591111d09d18a14f5ad66e2b6e13d827ee3e6f7ce06f5d0fbe0c"
|
||||
"sha256": "${PackageServer.FRUIT_1_1_SHA}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,8 +114,8 @@ data class CliBaseOptions(
|
||||
val testMode: Boolean = false,
|
||||
|
||||
/**
|
||||
* Unless -1, rewrites HTTP requests that specify port 12110 to the given port. This is an
|
||||
* internal test option.
|
||||
* Unless -1, rewrites HTTP requests that specify port 0 to the given port. This is an internal
|
||||
* test option.
|
||||
*/
|
||||
val testPort: Int = -1,
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"packageUri": "package://localhost:12110/badChecksum@1.0.0",
|
||||
"packageUri": "package://localhost:0/badChecksum@1.0.0",
|
||||
"name": "bugs",
|
||||
"packageZipUrl": "https://localhost:12110/badChecksum@1.0.0/badChecksum@1.0.0.zip",
|
||||
"packageZipUrl": "https://localhost:0/badChecksum@1.0.0/badChecksum@1.0.0.zip",
|
||||
"dependencies": {},
|
||||
"version": "1.0.0",
|
||||
"packageZipChecksums": {
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"packageUri": "package://localhost:12110/badImportsWithinPackage@1.1.0",
|
||||
"packageUri": "package://localhost:0/badImportsWithinPackage@1.1.0",
|
||||
"name": "badImportsWithinPackage",
|
||||
"packageZipUrl": "https://localhost:12110/badImportsWithinPackage@1.0.0/badImportsWithinPackage@1.0.0.zip",
|
||||
"packageZipUrl": "https://localhost:0/badImportsWithinPackage@1.0.0/badImportsWithinPackage@1.0.0.zip",
|
||||
"dependencies": {},
|
||||
"version": "1.0.0",
|
||||
"packageZipChecksums": {
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"packageUri": "package://localhost:12110/badPackagezipUrl@1.1.0",
|
||||
"packageUri": "package://localhost:0/badPackagezipUrl@1.1.0",
|
||||
"name": "bugs",
|
||||
"packageZipUrl": "ftp://wait/a/minute",
|
||||
"dependencies": {},
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"name": "birds",
|
||||
"packageUri": "package://localhost:12110/birds@0.5.0",
|
||||
"packageZipUrl": "https://localhost:12110/birds@0.5.0/birds@0.5.0.zip",
|
||||
"packageUri": "package://localhost:0/birds@0.5.0",
|
||||
"packageZipUrl": "https://localhost:0/birds@0.5.0/birds@0.5.0.zip",
|
||||
"dependencies": {
|
||||
"fruities": {
|
||||
"uri": "package://localhost:12110/fruit@1.0.5",
|
||||
"uri": "package://localhost:0/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
"sha256": "34a15b02346e6acb85da5bd71d8b0738a79008b38a7fc805e5869d9129ad27d2"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"packageUri": "package://localhost:12110/fruit@1.0.5",
|
||||
"packageUri": "package://localhost:0/fruit@1.0.5",
|
||||
"name": "fruit",
|
||||
"version": "1.0.5",
|
||||
"packageZipUrl": "https://localhost:12110/fruit@1.0.5/fruit@1.0.5.zip",
|
||||
"packageZipUrl": "https://localhost:0/fruit@1.0.5/fruit@1.0.5.zip",
|
||||
"dependencies": {},
|
||||
"packageZipChecksums": {
|
||||
"sha256": "$computedChecksum"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"packageUri": "package://localhost:12110/fruit@1.1.0",
|
||||
"packageUri": "package://localhost:0/fruit@1.1.0",
|
||||
"name": "fruit",
|
||||
"version": "1.1.0",
|
||||
"packageZipUrl": "https://localhost:12110/fruit@1.1.0/fruit@1.1.0.zip",
|
||||
"packageZipUrl": "https://localhost:0/fruit@1.1.0/fruit@1.1.0.zip",
|
||||
"dependencies": {},
|
||||
"packageZipChecksums": {
|
||||
"sha256": "$computedChecksum"
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"packageUri": "package://localhost:12110/packageContainingWildcardCharacters@1.0.0",
|
||||
"packageUri": "package://localhost:0/packageContainingWildcardCharacters@1.0.0",
|
||||
"name": "packageContainingWildcardCharacters",
|
||||
"version": "1.0.0",
|
||||
"packageZipUrl": "https://localhost:12110/packageContainingWildcardCharacters@1.0.0/packageContainingWildcardCharacters@1.0.0.zip",
|
||||
"packageZipUrl": "https://localhost:0/packageContainingWildcardCharacters@1.0.0/packageContainingWildcardCharacters@1.0.0.zip",
|
||||
"dependencies": {},
|
||||
"packageZipChecksums": {
|
||||
"sha256": "$computedChecksum"
|
||||
|
||||
@@ -41,11 +41,15 @@ import org.pkl.commons.deleteRecursively
|
||||
* * `testPort` Gradle property
|
||||
*
|
||||
* If the server isn't already running, it is automatically started.
|
||||
* 4. Use port `12110` in your test. `HttpClient` will replace this port with the server port.
|
||||
* 4. Use port `0` in your test. `HttpClient` will replace this port with the server port.
|
||||
* 4. [Close][close] the server, for example in [AfterAll][org.junit.jupiter.api.AfterAll].
|
||||
*/
|
||||
class PackageServer : AutoCloseable {
|
||||
companion object {
|
||||
const val BIRDS_SHA = "bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d"
|
||||
const val FRUIT_SHA = "34a15b02346e6acb85da5bd71d8b0738a79008b38a7fc805e5869d9129ad27d2"
|
||||
const val FRUIT_1_1_SHA = "8d982761d182f2185e4180c82190791d9a60c721cb3393bb2e946fab90131e8c"
|
||||
|
||||
fun populateCacheDir(cacheDir: Path) {
|
||||
val basePath = cacheDir.resolve("package-1/localhost:$PORT")
|
||||
basePath.deleteRecursively()
|
||||
@@ -65,7 +69,7 @@ class PackageServer : AutoCloseable {
|
||||
|
||||
// Port declared in tests.
|
||||
// Modified by RequestRewritingClient if testPort is set.
|
||||
private const val PORT = 12110
|
||||
private const val PORT = 0
|
||||
|
||||
private val packagesDir: Path =
|
||||
FileTestUtils.rootProjectDir.resolve("pkl-commons-test/build/test-packages")
|
||||
|
||||
@@ -111,8 +111,8 @@ public interface HttpClient extends AutoCloseable {
|
||||
/**
|
||||
* Sets a test server's listening port.
|
||||
*
|
||||
* <p>If set, requests that specify port 12110 will be modified to use the given port. This is
|
||||
* an internal test option.
|
||||
* <p>If set, requests that specify port 0 will be modified to use the given port. This is an
|
||||
* internal test option.
|
||||
*/
|
||||
Builder setTestPort(int port);
|
||||
|
||||
|
||||
@@ -105,9 +105,7 @@ final class RequestRewritingClient implements HttpClient {
|
||||
}
|
||||
|
||||
private URI rewriteUri(URI uri) {
|
||||
// Would be nice to use port 0 instead of 12110,
|
||||
// but this is best done in a separate commit.
|
||||
if (testPort != -1 && uri.getPort() == 12110) {
|
||||
if (testPort != -1 && uri.getPort() == 0) {
|
||||
return HttpUtils.setPort(uri, testPort);
|
||||
}
|
||||
return uri;
|
||||
|
||||
@@ -52,16 +52,16 @@ examples {
|
||||
}
|
||||
|
||||
["package"] {
|
||||
import*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
|
||||
import*("package://localhost:12110/birds@0.5.0#/**.pkl").keys.toListing()
|
||||
import*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
|
||||
import*("package://localhost:0/birds@0.5.0#/**.pkl").keys.toListing()
|
||||
}
|
||||
|
||||
["globbing with absolute URIs and percent encoding"] {
|
||||
import*("package://localhost:12110/packageContainingWildcardCharacters@1.0.0#/name%20*")
|
||||
import*("package://localhost:12110/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5C%5Bwildcard%5D!%20characters~~.pkl")
|
||||
import*("package://localhost:0/packageContainingWildcardCharacters@1.0.0#/name%20*")
|
||||
import*("package://localhost:0/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5C%5Bwildcard%5D!%20characters~~.pkl")
|
||||
}
|
||||
|
||||
["package glob and up one level"] {
|
||||
import*("package://localhost:12110/birds@0.5.0#/catalog/../catalog/*.pkl")
|
||||
import*("package://localhost:0/birds@0.5.0#/catalog/../catalog/*.pkl")
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,6 @@ examples {
|
||||
}
|
||||
|
||||
["package:"] {
|
||||
read*("package://localhost:12110/birds@0.5.0#/**.pkl")
|
||||
read*("package://localhost:0/birds@0.5.0#/**.pkl")
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// no semver
|
||||
res = import("package://localhost:12110/foo#/bar.pkl")
|
||||
res = import("package://localhost:0/foo#/bar.pkl")
|
||||
+1
-1
@@ -1 +1 @@
|
||||
res = import("package://localhost:12110/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl")
|
||||
res = import("package://localhost:0/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl")
|
||||
+1
-1
@@ -1 +1 @@
|
||||
res = import("package://localhost:12110/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl")
|
||||
res = import("package://localhost:0/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl")
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// invalid semver
|
||||
res = import("package://localhost:12110/foo@notAVersion#/bar.pkl")
|
||||
res = import("package://localhost:0/foo@notAVersion#/bar.pkl")
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// no fragment
|
||||
res = import("package://localhost:12110/bar/baz@1.0.0")
|
||||
res = import("package://localhost:0/bar/baz@1.0.0")
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// fragment path must be absolute
|
||||
res = import("package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl")
|
||||
res = import("package://localhost:0/birds@0.5.0#catalog/Swallow.pkl")
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
import "package://localhost:12110/badPackageZipUrl@1.0.0#/Bug.pkl"
|
||||
import "package://localhost:0/badPackageZipUrl@1.0.0#/Bug.pkl"
|
||||
|
||||
res: Bug
|
||||
+1
-1
@@ -1 +1 @@
|
||||
res = import("package://localhost:12110/badMetadataJson@1.0.0#/Bug.pkl")
|
||||
res = import("package://localhost:0/badMetadataJson@1.0.0#/Bug.pkl")
|
||||
+1
-1
@@ -1 +1 @@
|
||||
res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependency.pkl")
|
||||
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependency.pkl")
|
||||
+1
-1
@@ -1 +1 @@
|
||||
res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPath.pkl")
|
||||
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPath.pkl")
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// no semver
|
||||
res = read("package://localhost:12110/foo#/bar.pkl")
|
||||
res = read("package://localhost:0/foo#/bar.pkl")
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// invalid semver
|
||||
res = read("package://localhost:12110/foo@notAVersion#/bar.pkl")
|
||||
res = read("package://localhost:0/foo@notAVersion#/bar.pkl")
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// no fragment
|
||||
res = read("package://localhost:12110/bar/baz@1.0.0")
|
||||
res = read("package://localhost:0/bar/baz@1.0.0")
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// fragment path must be absolute
|
||||
res = read("package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl")
|
||||
res = read("package://localhost:0/birds@0.5.0#catalog/Swallow.pkl")
|
||||
+1
-1
@@ -1 +1 @@
|
||||
res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")
|
||||
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")
|
||||
+1
-1
@@ -1 +1 @@
|
||||
res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")
|
||||
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")
|
||||
@@ -1,7 +1,7 @@
|
||||
amends ".../snippetTest.pkl"
|
||||
|
||||
import "package://localhost:12110/birds@0.5.0#/Bird.pkl"
|
||||
import "package://localhost:12110/fruit@1.0.5#/Fruit.pkl"
|
||||
import "package://localhost:0/birds@0.5.0#/Bird.pkl"
|
||||
import "package://localhost:0/fruit@1.0.5#/Fruit.pkl"
|
||||
|
||||
examples {
|
||||
["basic imports"] {
|
||||
@@ -12,15 +12,15 @@ examples {
|
||||
name = "Banana"
|
||||
}
|
||||
}
|
||||
import("package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl")
|
||||
import("package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl")
|
||||
import("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl")
|
||||
import("package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl")
|
||||
}
|
||||
["importing while specifying checksum"] {
|
||||
import("package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Swallow.pkl")
|
||||
import("package://localhost:0/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Swallow.pkl")
|
||||
}
|
||||
["reads"] {
|
||||
read("package://localhost:12110/birds@0.5.0#/Bird.pkl")
|
||||
read("package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl")
|
||||
read("package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl")
|
||||
read("package://localhost:0/birds@0.5.0#/Bird.pkl")
|
||||
read("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl")
|
||||
read("package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl")
|
||||
}
|
||||
}
|
||||
@@ -2,24 +2,24 @@ amends ".../snippetTest.pkl"
|
||||
|
||||
examples {
|
||||
["glob import"] {
|
||||
import*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
|
||||
import*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
|
||||
}
|
||||
["glob import within package"] {
|
||||
import("package://localhost:12110/birds@0.5.0#/catalog.pkl").catalog
|
||||
import("package://localhost:0/birds@0.5.0#/catalog.pkl").catalog
|
||||
}
|
||||
["glob import transitive dep within package"] {
|
||||
import("package://localhost:12110/birds@0.5.0#/allFruit.pkl").fruit
|
||||
import("package://localhost:0/birds@0.5.0#/allFruit.pkl").fruit
|
||||
}
|
||||
["glob read"] {
|
||||
read*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
|
||||
read*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
|
||||
}
|
||||
["glob read within package"] {
|
||||
import("package://localhost:12110/birds@0.5.0#/catalog.pkl").catalogFiles
|
||||
import("package://localhost:0/birds@0.5.0#/catalog.pkl").catalogFiles
|
||||
}
|
||||
["glob read transitive dep within package"] {
|
||||
import("package://localhost:12110/birds@0.5.0#/allFruit.pkl").fruitFiles
|
||||
import("package://localhost:0/birds@0.5.0#/allFruit.pkl").fruitFiles
|
||||
}
|
||||
["glob import while specifying checksum"] {
|
||||
import*("package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/*.pkl")
|
||||
import*("package://localhost:0/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/*.pkl")
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,6 +2,6 @@ amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,6 +2,6 @@ amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,6 +2,6 @@ amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,6 +3,6 @@ amends "pkl:Project"
|
||||
dependencies {
|
||||
["birds"] {
|
||||
// Should fail because dependency is out of date (PklProject.deps.json version is older)
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
Vendored
+4
-4
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.0",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.0.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@ amends "pkl:Project"
|
||||
dependencies {
|
||||
["birds"] {
|
||||
// out of date because PklProject declares version 0.5.0
|
||||
uri = "package://localhost:12110/birds@0.8.0"
|
||||
uri = "package://localhost:0/birds@0.8.0"
|
||||
}
|
||||
}
|
||||
Vendored
+4
-4
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@ amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -2,13 +2,13 @@ amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
["fruits"] {
|
||||
uri = "package://localhost:12110/fruit@1.1.0"
|
||||
uri = "package://localhost:0/fruit@1.1.0"
|
||||
}
|
||||
["badImportsWithinPackage"] {
|
||||
uri = "package://localhost:12110/badImportsWithinPackage@1.0.0"
|
||||
uri = "package://localhost:0/badImportsWithinPackage@1.0.0"
|
||||
}
|
||||
["project2"] = import("../project2/PklProject")
|
||||
}
|
||||
+8
-8
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/project2@1": {
|
||||
"package://localhost:0/project2@1": {
|
||||
"type": "local",
|
||||
"uri": "projectpackage://localhost:12110/project2@1.0.0",
|
||||
"uri": "projectpackage://localhost:0/project2@1.0.0",
|
||||
"path": "../project2/"
|
||||
},
|
||||
"package://localhost:12110/badImportsWithinPackage@1": {
|
||||
"package://localhost:0/badImportsWithinPackage@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/badImportsWithinPackage@1.0.0",
|
||||
"uri": "projectpackage://localhost:0/badImportsWithinPackage@1.0.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
|
||||
+4
-4
@@ -22,16 +22,16 @@ examples {
|
||||
|
||||
facts {
|
||||
["package-relative dependency is not same import as absolute URI dependency"] {
|
||||
import("@birds/Bird.pkl") != import("package://localhost:12110/birds@0.5.0#/Bird.pkl")
|
||||
import("@birds/Bird.pkl") != import("package://localhost:0/birds@0.5.0#/Bird.pkl")
|
||||
}
|
||||
["package-relative dependency has scheme projectpackage"] {
|
||||
import("@birds/Bird.pkl") == import("projectpackage://localhost:12110/birds@0.5.0#/Bird.pkl")
|
||||
import("@birds/Bird.pkl") == import("projectpackage://localhost:0/birds@0.5.0#/Bird.pkl")
|
||||
}
|
||||
["transitive import resolves to same dependency as direct dependency import"] {
|
||||
Swallow.favoriteFruit == import("@fruits/catalog/apple.pkl")
|
||||
}
|
||||
["transitive import resolves to same dependency as projectpackage import"] {
|
||||
Swallow.favoriteFruit == import("projectpackage://localhost:12110/fruit@1.1.0#/catalog/apple.pkl")
|
||||
Swallow.favoriteFruit != import("projectpackage://localhost:12110/fruit@1.0.5#/catalog/apple.pkl")
|
||||
Swallow.favoriteFruit == import("projectpackage://localhost:0/fruit@1.1.0#/catalog/apple.pkl")
|
||||
Swallow.favoriteFruit != import("projectpackage://localhost:0/fruit@1.0.5#/catalog/apple.pkl")
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ examples {
|
||||
}
|
||||
|
||||
["glob-import absolute package uri"] {
|
||||
import*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
|
||||
import*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
|
||||
}
|
||||
|
||||
["glob-import local project"] {
|
||||
@@ -32,6 +32,6 @@ examples {
|
||||
}
|
||||
|
||||
["glob-read absolute package uri"] {
|
||||
read*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
|
||||
read*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -2,13 +2,13 @@ amends "pkl:Project"
|
||||
|
||||
package {
|
||||
name = "project2"
|
||||
baseUri = "package://localhost:12110/project2"
|
||||
baseUri = "package://localhost:0/project2"
|
||||
version = "1.0.0"
|
||||
packageZipUrl = "https://localhost:12110/project2/project2-\(version).zip"
|
||||
packageZipUrl = "https://localhost:0/project2/project2-\(version).zip"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
["burds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
|
||||
+8
-8
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/project2@1": {
|
||||
"package://localhost:0/project2@1": {
|
||||
"type": "local",
|
||||
"uri": "projectpackage://localhost:12110/project2@1.0.0",
|
||||
"uri": "projectpackage://localhost:0/project2@1.0.0",
|
||||
"path": "../project2/"
|
||||
},
|
||||
"package://localhost:12110/badImportsWithinPackage@1": {
|
||||
"package://localhost:0/badImportsWithinPackage@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/badImportsWithinPackage@1.0.0",
|
||||
"uri": "projectpackage://localhost:0/badImportsWithinPackage@1.0.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@ amends "pkl:Project"
|
||||
dependencies {
|
||||
["fruit"] {
|
||||
// need to manually keep the checksum in `PklProject.deps.json` in sync
|
||||
uri = "package://localhost:12110/fruit@1.0.5"
|
||||
uri = "package://localhost:0/fruit@1.0.5"
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
"sha256": "34a15b02346e6acb85da5bd71d8b0738a79008b38a7fc805e5869d9129ad27d2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import "pkl:reflect"
|
||||
myProject: Project = (Project.newInstance(module)) {
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
|
||||
@@ -69,13 +69,13 @@ examples {
|
||||
}
|
||||
["package"] {
|
||||
new {
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
name = "Swallow"
|
||||
favoriteFruit {
|
||||
name = "Apple"
|
||||
@@ -83,31 +83,31 @@ examples {
|
||||
}
|
||||
}
|
||||
new {
|
||||
"package://localhost:12110/birds@0.5.0#/Bird.pkl"
|
||||
"package://localhost:12110/birds@0.5.0#/allFruit.pkl"
|
||||
"package://localhost:12110/birds@0.5.0#/catalog.pkl"
|
||||
"package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
"package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
"package://localhost:12110/birds@0.5.0#/some/dir/Bird.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/Bird.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/allFruit.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/catalog.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"
|
||||
}
|
||||
}
|
||||
["globbing with absolute URIs and percent encoding"] {
|
||||
new {
|
||||
["package://localhost:12110/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5Bwildcard%5D!%20characters~~.pkl"] {}
|
||||
["package://localhost:0/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5Bwildcard%5D!%20characters~~.pkl"] {}
|
||||
}
|
||||
new {
|
||||
["package://localhost:12110/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5Bwildcard%5D!%20characters~~.pkl"] {}
|
||||
["package://localhost:0/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5Bwildcard%5D!%20characters~~.pkl"] {}
|
||||
}
|
||||
}
|
||||
["package glob and up one level"] {
|
||||
new {
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/../catalog/Ostritch.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/../catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/../catalog/Swallow.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/../catalog/Swallow.pkl"] {
|
||||
name = "Swallow"
|
||||
favoriteFruit {
|
||||
name = "Apple"
|
||||
|
||||
@@ -96,8 +96,8 @@ examples {
|
||||
}
|
||||
["package:"] {
|
||||
new {
|
||||
["package://localhost:12110/birds@0.5.0#/Bird.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/Bird.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/Bird.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/Bird.pkl"
|
||||
text = """
|
||||
open module birds.Bird
|
||||
|
||||
@@ -110,8 +110,8 @@ examples {
|
||||
"""
|
||||
base64 = "b3BlbiBtb2R1bGUgYmlyZHMuQmlyZAoKaW1wb3J0ICJAZnJ1aXRpZXMvRnJ1aXQucGtsIgoKbmFtZTogU3RyaW5nCgpmYXZvcml0ZUZydWl0OiBGcnVpdAo="
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/allFruit.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/allFruit.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/allFruit.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/allFruit.pkl"
|
||||
text = """
|
||||
module birds.allFruit
|
||||
|
||||
@@ -121,8 +121,8 @@ examples {
|
||||
"""
|
||||
base64 = "bW9kdWxlIGJpcmRzLmFsbEZydWl0CgpmcnVpdCA9IGltcG9ydCooIkBmcnVpdGllcy9jYXRhbG9nLyoucGtsIikKZnJ1aXRGaWxlcyA9IHJlYWQqKCJAZnJ1aXRpZXMvY2F0YWxvZy8qLnBrbCIpCg=="
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/catalog.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog.pkl"
|
||||
text = """
|
||||
module birds.catalog
|
||||
|
||||
@@ -132,8 +132,8 @@ examples {
|
||||
"""
|
||||
base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo="
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -146,8 +146,8 @@ examples {
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -160,8 +160,8 @@ examples {
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCmltcG9ydCAiQGZydWl0aWVzL2NhdGFsb2cvYXBwbGUucGtsIgoKbmFtZSA9ICJTd2FsbG93IgoKZmF2b3JpdGVGcnVpdCA9IGFwcGxlCg=="
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/some/dir/Bird.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/some/dir/Bird.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"
|
||||
text = """
|
||||
amends "..."
|
||||
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Module URI `package://localhost:12110/foo#/bar.pkl` has invalid syntax.
|
||||
Module URI `package://localhost:0/foo#/bar.pkl` has invalid syntax.
|
||||
|
||||
x | res = import("package://localhost:12110/foo#/bar.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = import("package://localhost:0/foo#/bar.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badImport1.error#res (file:///$snippetsDir/input/packages/badImport1.error.pkl)
|
||||
|
||||
Invalid path `/foo`.
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Module URI `package://localhost:12110/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl` has invalid syntax.
|
||||
Module URI `package://localhost:0/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl` has invalid syntax.
|
||||
|
||||
x | res = import("package://localhost:12110/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = import("package://localhost:0/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badImport10.error#res (file:///$snippetsDir/input/packages/badImport10.error.pkl)
|
||||
|
||||
Unrecognized checksum algorithm: `invalidalgo`.
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Module URI `package://localhost:12110/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl` has invalid syntax.
|
||||
Module URI `package://localhost:0/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl` has invalid syntax.
|
||||
|
||||
x | res = import("package://localhost:12110/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = import("package://localhost:0/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badImport11.error#res (file:///$snippetsDir/input/packages/badImport11.error.pkl)
|
||||
|
||||
Invalid checksum specification: `boguschecksumpart`.
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Module URI `package://localhost:12110/foo@notAVersion#/bar.pkl` has invalid syntax.
|
||||
Module URI `package://localhost:0/foo@notAVersion#/bar.pkl` has invalid syntax.
|
||||
|
||||
x | res = import("package://localhost:12110/foo@notAVersion#/bar.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = import("package://localhost:0/foo@notAVersion#/bar.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badImport2.error#res (file:///$snippetsDir/input/packages/badImport2.error.pkl)
|
||||
|
||||
`notAVersion` could not be parsed as a semantic version number.
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Module URI `package://localhost:12110/bar/baz@1.0.0` has invalid syntax.
|
||||
Module URI `package://localhost:0/bar/baz@1.0.0` has invalid syntax.
|
||||
|
||||
x | res = import("package://localhost:12110/bar/baz@1.0.0")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = import("package://localhost:0/bar/baz@1.0.0")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badImport3.error#res (file:///$snippetsDir/input/packages/badImport3.error.pkl)
|
||||
|
||||
Expected URI to contain a fragment.
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Module URI `package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl` has invalid syntax.
|
||||
Module URI `package://localhost:0/birds@0.5.0#catalog/Swallow.pkl` has invalid syntax.
|
||||
|
||||
x | res = import("package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = import("package://localhost:0/birds@0.5.0#catalog/Swallow.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badImport4.error#res (file:///$snippetsDir/input/packages/badImport4.error.pkl)
|
||||
|
||||
Cannot have a relative fragment path `catalog/Swallow.pkl`.
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Expected the zip asset for package `package://localhost:12110/badPackageZipUrl@1.0.0` to be an HTTPS URI, but got `ftp://wait/a/minute`.
|
||||
Expected the zip asset for package `package://localhost:0/badPackageZipUrl@1.0.0` to be an HTTPS URI, but got `ftp://wait/a/minute`.
|
||||
|
||||
x | import "package://localhost:12110/badPackageZipUrl@1.0.0#/Bug.pkl"
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | import "package://localhost:0/badPackageZipUrl@1.0.0#/Bug.pkl"
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badImport6.error#Bug (file:///$snippetsDir/input/packages/badImport6.error.pkl)
|
||||
|
||||
x | res: Bug
|
||||
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
–– Pkl Error ––
|
||||
Received invalid dependency metadata for package `package://localhost:12110/badMetadataJson@1.0.0` when making request `GET https://localhost:12110/badMetadataJson@1.0.0`:
|
||||
Received invalid dependency metadata for package `package://localhost:0/badMetadataJson@1.0.0` when making request `GET https://localhost:0/badMetadataJson@1.0.0`:
|
||||
Malformed JSON: Expected 'r' at 1:2.
|
||||
|
||||
Original input:
|
||||
`this is not json
|
||||
`
|
||||
|
||||
x | res = import("package://localhost:12110/badMetadataJson@1.0.0#/Bug.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = import("package://localhost:0/badMetadataJson@1.0.0#/Bug.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badImport7.error#res (file:///$snippetsDir/input/packages/badImport7.error.pkl)
|
||||
|
||||
xxx | text = renderer.renderDocument(value)
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
–– Pkl Error ––
|
||||
Cannot find dependency named `fruits`, because it was not declared in package `package://localhost:12110/badImportsWithinPackage@1.0.0`.
|
||||
Cannot find dependency named `fruits`, because it was not declared in package `package://localhost:0/badImportsWithinPackage@1.0.0`.
|
||||
|
||||
x | res = import("@fruits/Foo.pkl")
|
||||
^^^^^^^^^^^^^^^^^
|
||||
at badImport8.error#res (package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependency.pkl)
|
||||
at badImport8.error#res (package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependency.pkl)
|
||||
|
||||
xxx | text = renderer.renderDocument(value)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
–– Pkl Error ––
|
||||
Cannot find module `package://localhost:12110/badImportsWithinPackage@1.0.0#/not/a/valid/path.pkl`.
|
||||
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/not/a/valid/path.pkl`.
|
||||
|
||||
x | res = import("not/a/valid/path.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at invalidPath#res (package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPath.pkl)
|
||||
at invalidPath#res (package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPath.pkl)
|
||||
|
||||
xxx | text = renderer.renderDocument(value)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Resource URI `package://localhost:12110/foo#/bar.pkl` has invalid syntax.
|
||||
Resource URI `package://localhost:0/foo#/bar.pkl` has invalid syntax.
|
||||
|
||||
x | res = read("package://localhost:12110/foo#/bar.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = read("package://localhost:0/foo#/bar.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badRead1.error#res (file:///$snippetsDir/input/packages/badRead1.error.pkl)
|
||||
|
||||
Invalid path `/foo`.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Resource URI `package://localhost:12110/foo@notAVersion#/bar.pkl` has invalid syntax.
|
||||
Resource URI `package://localhost:0/foo@notAVersion#/bar.pkl` has invalid syntax.
|
||||
|
||||
x | res = read("package://localhost:12110/foo@notAVersion#/bar.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = read("package://localhost:0/foo@notAVersion#/bar.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badRead2.error#res (file:///$snippetsDir/input/packages/badRead2.error.pkl)
|
||||
|
||||
`notAVersion` could not be parsed as a semantic version number.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Resource URI `package://localhost:12110/bar/baz@1.0.0` has invalid syntax.
|
||||
Resource URI `package://localhost:0/bar/baz@1.0.0` has invalid syntax.
|
||||
|
||||
x | res = read("package://localhost:12110/bar/baz@1.0.0")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = read("package://localhost:0/bar/baz@1.0.0")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badRead3.error#res (file:///$snippetsDir/input/packages/badRead3.error.pkl)
|
||||
|
||||
Expected URI to contain a fragment.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Resource URI `package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl` has invalid syntax.
|
||||
Resource URI `package://localhost:0/birds@0.5.0#catalog/Swallow.pkl` has invalid syntax.
|
||||
|
||||
x | res = read("package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = read("package://localhost:0/birds@0.5.0#catalog/Swallow.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badRead4.error#res (file:///$snippetsDir/input/packages/badRead4.error.pkl)
|
||||
|
||||
Cannot have a relative fragment path `catalog/Swallow.pkl`.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Cannot find module `package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl`.
|
||||
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl`.
|
||||
|
||||
x | res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badRead8.error#res (file:///$snippetsDir/input/packages/badRead8.error.pkl)
|
||||
|
||||
xxx | text = renderer.renderDocument(value)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Cannot find module `package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl`.
|
||||
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl`.
|
||||
|
||||
x | res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
x | res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badRead9.error#res (file:///$snippetsDir/input/packages/badRead9.error.pkl)
|
||||
|
||||
xxx | text = renderer.renderDocument(value)
|
||||
|
||||
@@ -29,7 +29,7 @@ examples {
|
||||
}
|
||||
["reads"] {
|
||||
new {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/Bird.pkl"
|
||||
uri = "package://localhost:0/birds@0.5.0#/Bird.pkl"
|
||||
text = """
|
||||
open module birds.Bird
|
||||
|
||||
@@ -43,7 +43,7 @@ examples {
|
||||
base64 = "b3BlbiBtb2R1bGUgYmlyZHMuQmlyZAoKaW1wb3J0ICJAZnJ1aXRpZXMvRnJ1aXQucGtsIgoKbmFtZTogU3RyaW5nCgpmYXZvcml0ZUZydWl0OiBGcnVpdAo="
|
||||
}
|
||||
new {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -57,7 +57,7 @@ examples {
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCmltcG9ydCAiQGZydWl0aWVzL2NhdGFsb2cvYXBwbGUucGtsIgoKbmFtZSA9ICJTd2FsbG93IgoKZmF2b3JpdGVGcnVpdCA9IGFwcGxlCg=="
|
||||
}
|
||||
new {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
|
||||
+11
-11
@@ -1,13 +1,13 @@
|
||||
examples {
|
||||
["glob import"] {
|
||||
new {
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
name = "Swallow"
|
||||
favoriteFruit {
|
||||
name = "Apple"
|
||||
@@ -40,8 +40,8 @@ examples {
|
||||
}
|
||||
["glob read"] {
|
||||
new {
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -54,8 +54,8 @@ examples {
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -73,7 +73,7 @@ examples {
|
||||
["glob read within package"] {
|
||||
new {
|
||||
["catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -87,7 +87,7 @@ examples {
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
}
|
||||
["catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -105,7 +105,7 @@ examples {
|
||||
["glob read transitive dep within package"] {
|
||||
new {
|
||||
["@fruities/catalog/apple.pkl"] {
|
||||
uri = "package://localhost:12110/fruit@1.0.5#/catalog/apple.pkl"
|
||||
uri = "package://localhost:0/fruit@1.0.5#/catalog/apple.pkl"
|
||||
text = """
|
||||
amends "../Fruit.pkl"
|
||||
|
||||
@@ -118,13 +118,13 @@ examples {
|
||||
}
|
||||
["glob import while specifying checksum"] {
|
||||
new {
|
||||
["package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Ostritch.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Swallow.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Swallow.pkl"] {
|
||||
name = "Swallow"
|
||||
favoriteFruit {
|
||||
name = "Apple"
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
–– Pkl Error ––
|
||||
Did not find a resolved dependency for package `package://localhost:12110/birds@0.5.0`.
|
||||
Did not find a resolved dependency for package `package://localhost:0/birds@0.5.0`.
|
||||
|
||||
Run `pkl project resolve` to update resolved dependencies.
|
||||
|
||||
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
–– Pkl Error ––
|
||||
Transitive dependency declared by package `package://localhost:12110/birds@0.5.0` is newer than what is declared in `PklProject.deps.json`.
|
||||
Transitive dependency declared by package `package://localhost:0/birds@0.5.0` is newer than what is declared in `PklProject.deps.json`.
|
||||
|
||||
Declared: `package://localhost:12110/fruit@1.0.5`
|
||||
Resolved: `package://localhost:12110/fruit@1.0.0`
|
||||
Declared: `package://localhost:0/fruit@1.0.5`
|
||||
Resolved: `package://localhost:0/fruit@1.0.0`
|
||||
|
||||
Run `pkl project resolve` to update resolved dependencies.
|
||||
|
||||
x | import "@fruities/Fruit.pkl"
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
at bug#Bird (projectpackage://localhost:12110/birds@0.5.0#/Bird.pkl)
|
||||
at bug#Bird (projectpackage://localhost:0/birds@0.5.0#/Bird.pkl)
|
||||
|
||||
x | bird: Bird
|
||||
^^^^
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Project `file:///$snippetsDir/input/projects/badProjectDeps6/PklProject` declares a dependency on a package that is newer than what is declared in `PklProject.deps.json`.
|
||||
|
||||
Declared: `package://localhost:12110/birds@0.8.0`
|
||||
Resolved: `package://localhost:12110/birds@0.5.0`
|
||||
Declared: `package://localhost:0/birds@0.8.0`
|
||||
Resolved: `package://localhost:0/birds@0.5.0`
|
||||
|
||||
Run `pkl project resolve` to update resolved dependencies.
|
||||
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
–– Pkl Error ––
|
||||
Cannot find dependency named `fruits`, because it was not declared in package `package://localhost:12110/badImportsWithinPackage@1.0.0`.
|
||||
Cannot find dependency named `fruits`, because it was not declared in package `package://localhost:0/badImportsWithinPackage@1.0.0`.
|
||||
|
||||
x | res = import("@fruits/Foo.pkl")
|
||||
^^^^^^^^^^^^^^^^^
|
||||
at badImport3.error#res (projectpackage://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependency.pkl)
|
||||
at badImport3.error#res (projectpackage://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependency.pkl)
|
||||
|
||||
xxx | text = renderer.renderDocument(value)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ examples {
|
||||
}
|
||||
["reading directories"] {
|
||||
new {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog"
|
||||
text = """
|
||||
Ostritch.pkl
|
||||
Swallow.pkl
|
||||
@@ -47,7 +47,7 @@ examples {
|
||||
base64 = "T3N0cml0Y2gucGtsClN3YWxsb3cucGtsCg=="
|
||||
}
|
||||
new {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/"
|
||||
text = """
|
||||
Bird.pkl
|
||||
allFruit.pkl
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
–– Pkl Error ––
|
||||
I/O error loading module `projectpackage://localhost:12110/birds@0.5.0#/`.
|
||||
I/O error loading module `projectpackage://localhost:0/birds@0.5.0#/`.
|
||||
IOException: Is a directory
|
||||
|
||||
x | res = import("@birds")
|
||||
|
||||
+19
-19
@@ -17,13 +17,13 @@ examples {
|
||||
}
|
||||
["glob-import absolute package uri"] {
|
||||
new {
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
name = "Swallow"
|
||||
favoriteFruit {
|
||||
name = "Apple"
|
||||
@@ -42,7 +42,7 @@ examples {
|
||||
["glob-read using dependency notation"] {
|
||||
new {
|
||||
["@birds/catalog/Ostritch.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -56,7 +56,7 @@ examples {
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
}
|
||||
["@birds/catalog/Swallow.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -72,7 +72,7 @@ examples {
|
||||
}
|
||||
new {
|
||||
["@birds/Bird.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/Bird.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/Bird.pkl"
|
||||
text = """
|
||||
open module birds.Bird
|
||||
|
||||
@@ -86,7 +86,7 @@ examples {
|
||||
base64 = "b3BlbiBtb2R1bGUgYmlyZHMuQmlyZAoKaW1wb3J0ICJAZnJ1aXRpZXMvRnJ1aXQucGtsIgoKbmFtZTogU3RyaW5nCgpmYXZvcml0ZUZydWl0OiBGcnVpdAo="
|
||||
}
|
||||
["@birds/allFruit.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/allFruit.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/allFruit.pkl"
|
||||
text = """
|
||||
module birds.allFruit
|
||||
|
||||
@@ -97,7 +97,7 @@ examples {
|
||||
base64 = "bW9kdWxlIGJpcmRzLmFsbEZydWl0CgpmcnVpdCA9IGltcG9ydCooIkBmcnVpdGllcy9jYXRhbG9nLyoucGtsIikKZnJ1aXRGaWxlcyA9IHJlYWQqKCJAZnJ1aXRpZXMvY2F0YWxvZy8qLnBrbCIpCg=="
|
||||
}
|
||||
["@birds/catalog.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog.pkl"
|
||||
text = """
|
||||
module birds.catalog
|
||||
|
||||
@@ -110,7 +110,7 @@ examples {
|
||||
}
|
||||
new {
|
||||
["@birds/Bird.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/Bird.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/Bird.pkl"
|
||||
text = """
|
||||
open module birds.Bird
|
||||
|
||||
@@ -124,7 +124,7 @@ examples {
|
||||
base64 = "b3BlbiBtb2R1bGUgYmlyZHMuQmlyZAoKaW1wb3J0ICJAZnJ1aXRpZXMvRnJ1aXQucGtsIgoKbmFtZTogU3RyaW5nCgpmYXZvcml0ZUZydWl0OiBGcnVpdAo="
|
||||
}
|
||||
["@birds/allFruit.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/allFruit.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/allFruit.pkl"
|
||||
text = """
|
||||
module birds.allFruit
|
||||
|
||||
@@ -135,7 +135,7 @@ examples {
|
||||
base64 = "bW9kdWxlIGJpcmRzLmFsbEZydWl0CgpmcnVpdCA9IGltcG9ydCooIkBmcnVpdGllcy9jYXRhbG9nLyoucGtsIikKZnJ1aXRGaWxlcyA9IHJlYWQqKCJAZnJ1aXRpZXMvY2F0YWxvZy8qLnBrbCIpCg=="
|
||||
}
|
||||
["@birds/catalog.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog.pkl"
|
||||
text = """
|
||||
module birds.catalog
|
||||
|
||||
@@ -146,7 +146,7 @@ examples {
|
||||
base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo="
|
||||
}
|
||||
["@birds/catalog/Ostritch.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -160,7 +160,7 @@ examples {
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
}
|
||||
["@birds/catalog/Swallow.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -174,7 +174,7 @@ examples {
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCmltcG9ydCAiQGZydWl0aWVzL2NhdGFsb2cvYXBwbGUucGtsIgoKbmFtZSA9ICJTd2FsbG93IgoKZmF2b3JpdGVGcnVpdCA9IGFwcGxlCg=="
|
||||
}
|
||||
["@birds/some/dir/Bird.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/some/dir/Bird.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"
|
||||
text = """
|
||||
amends "..."
|
||||
|
||||
@@ -192,7 +192,7 @@ examples {
|
||||
["glob-read within package"] {
|
||||
new {
|
||||
["catalog/Ostritch.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -206,7 +206,7 @@ examples {
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
}
|
||||
["catalog/Swallow.pkl"] {
|
||||
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -223,8 +223,8 @@ examples {
|
||||
}
|
||||
["glob-read absolute package uri"] {
|
||||
new {
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
@@ -237,8 +237,8 @@ examples {
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
}
|
||||
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class StackFrameTransformersTest {
|
||||
.setHttpClient(httpClient)
|
||||
.build().use {
|
||||
val frame = StackFrame(
|
||||
"package://localhost:12110/birds@0.5.0#/Bird.pkl",
|
||||
"package://localhost:0/birds@0.5.0#/Bird.pkl",
|
||||
null,
|
||||
listOf(),
|
||||
1,
|
||||
|
||||
@@ -104,10 +104,10 @@ class RequestRewritingClientTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `rewrites port 12110 if test port is set`() {
|
||||
fun `rewrites port 0 if test port is set`() {
|
||||
val captured = RequestCapturingClient()
|
||||
val client = RequestRewritingClient("Pkl", Duration.ofSeconds(42), 5000, captured)
|
||||
val request = HttpRequest.newBuilder(URI("https://example.com:12110")).build()
|
||||
val request = HttpRequest.newBuilder(URI("https://example.com:0")).build()
|
||||
|
||||
client.send(request, BodyHandlers.discarding())
|
||||
|
||||
@@ -115,12 +115,12 @@ class RequestRewritingClientTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `leaves port 12110 intact if no test port is set`() {
|
||||
val request = HttpRequest.newBuilder(URI("https://example.com:12110")).build()
|
||||
fun `leaves port 0 intact if no test port is set`() {
|
||||
val request = HttpRequest.newBuilder(URI("https://example.com:0")).build()
|
||||
|
||||
client.send(request, BodyHandlers.discarding())
|
||||
|
||||
assertThat(captured.request.uri().port).isEqualTo(12110)
|
||||
assertThat(captured.request.uri().port).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ class ModuleKeysTest {
|
||||
@Test
|
||||
fun `package - no version`() {
|
||||
val e = assertThrows<URISyntaxException> {
|
||||
ModuleKeys.pkg(URI("package://localhost:12110/birds#/Bird.pkl"))
|
||||
ModuleKeys.pkg(URI("package://localhost:0/birds#/Bird.pkl"))
|
||||
}
|
||||
assertThat(e).hasMessageContaining("A package URI must have its path suffixed by its version")
|
||||
}
|
||||
@@ -168,7 +168,7 @@ class ModuleKeysTest {
|
||||
@Test
|
||||
fun `package - invalid semver`() {
|
||||
val e = assertThrows<URISyntaxException> {
|
||||
ModuleKeys.pkg(URI("package://localhost:12110/birds@notAVersion#/Bird.pkl"))
|
||||
ModuleKeys.pkg(URI("package://localhost:0/birds@notAVersion#/Bird.pkl"))
|
||||
}
|
||||
assertThat(e).hasMessageContaining("`notAVersion` could not be parsed")
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class PackageResolversTest {
|
||||
@Test
|
||||
fun `get module bytes`() {
|
||||
val expectedBirdModule = packageRoot.resolve("birds@0.5.0/package/Bird.pkl").readString(StandardCharsets.UTF_8)
|
||||
val assetUri = PackageAssetUri("package://localhost:12110/birds@0.5.0#/Bird.pkl")
|
||||
val assetUri = PackageAssetUri("package://localhost:0/birds@0.5.0#/Bird.pkl")
|
||||
val birdModule = resolver
|
||||
.getBytes(assetUri, false, null)
|
||||
.toString(StandardCharsets.UTF_8)
|
||||
@@ -56,7 +56,7 @@ class PackageResolversTest {
|
||||
|
||||
@Test
|
||||
fun `get directory`() {
|
||||
val assetUri = PackageAssetUri("package://localhost:12110/birds@0.5.0#/")
|
||||
val assetUri = PackageAssetUri("package://localhost:0/birds@0.5.0#/")
|
||||
val err = assertThrows<IOException> {
|
||||
resolver
|
||||
.getBytes(assetUri, false, null)
|
||||
@@ -67,7 +67,7 @@ class PackageResolversTest {
|
||||
|
||||
@Test
|
||||
fun `get directory, allowing directory reads`() {
|
||||
val assetUri = PackageAssetUri("package://localhost:12110/birds@0.5.0#/")
|
||||
val assetUri = PackageAssetUri("package://localhost:0/birds@0.5.0#/")
|
||||
val bytes = resolver
|
||||
.getBytes(assetUri, true, null)
|
||||
.toString(StandardCharsets.UTF_8)
|
||||
@@ -84,7 +84,7 @@ class PackageResolversTest {
|
||||
@Test
|
||||
fun `get module bytes resolving path`() {
|
||||
val expectedBirdModule = packageRoot.resolve("birds@0.5.0/package/Bird.pkl").readString(StandardCharsets.UTF_8)
|
||||
val assetUri = PackageAssetUri("package://localhost:12110/birds@0.5.0#/foo/../Bird.pkl")
|
||||
val assetUri = PackageAssetUri("package://localhost:0/birds@0.5.0#/foo/../Bird.pkl")
|
||||
val birdModule = resolver
|
||||
.getBytes(assetUri, false, null)
|
||||
.toString(StandardCharsets.UTF_8)
|
||||
@@ -95,7 +95,7 @@ class PackageResolversTest {
|
||||
fun `list path elements at root`() {
|
||||
// cast to set to avoid sort issues
|
||||
val elements = resolver
|
||||
.listElements(PackageAssetUri("package://localhost:12110/birds@0.5.0#/"), null)
|
||||
.listElements(PackageAssetUri("package://localhost:0/birds@0.5.0#/"), null)
|
||||
.toSet()
|
||||
assertThat(elements).isEqualTo(
|
||||
setOf(
|
||||
@@ -111,12 +111,12 @@ class PackageResolversTest {
|
||||
@Test
|
||||
fun `get multiple assets`() {
|
||||
val bird = resolver.getBytes(
|
||||
PackageAssetUri("package://localhost:12110/birds@0.5.0#/Bird.pkl"),
|
||||
PackageAssetUri("package://localhost:0/birds@0.5.0#/Bird.pkl"),
|
||||
false,
|
||||
null
|
||||
)
|
||||
val swallow = resolver.getBytes(
|
||||
PackageAssetUri("package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"),
|
||||
PackageAssetUri("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"),
|
||||
false,
|
||||
null
|
||||
)
|
||||
@@ -127,7 +127,7 @@ class PackageResolversTest {
|
||||
@Test
|
||||
fun `list path elements in nested directory`() {
|
||||
// cast to set to avoid sort issues
|
||||
val elements = resolver.listElements(PackageAssetUri("package://localhost:12110/birds@0.5.0#/catalog/"), null).toSet()
|
||||
val elements = resolver.listElements(PackageAssetUri("package://localhost:0/birds@0.5.0#/catalog/"), null).toSet()
|
||||
assertThat(elements).isEqualTo(
|
||||
setOf(
|
||||
PathElement("Ostritch.pkl", false),
|
||||
@@ -141,7 +141,7 @@ class PackageResolversTest {
|
||||
assertThrows<FileNotFoundException> {
|
||||
resolver
|
||||
.getBytes(
|
||||
PackageAssetUri("package://localhost:12110/birds@0.5.0#/Horse.pkl"),
|
||||
PackageAssetUri("package://localhost:0/birds@0.5.0#/Horse.pkl"),
|
||||
false,
|
||||
null
|
||||
)
|
||||
@@ -154,7 +154,7 @@ class PackageResolversTest {
|
||||
assertThrows<PackageLoadError> {
|
||||
resolver
|
||||
.getBytes(
|
||||
PackageAssetUri("package://localhost:12110/not-a-package@0.5.0#/Horse.pkl"),
|
||||
PackageAssetUri("package://localhost:0/not-a-package@0.5.0#/Horse.pkl"),
|
||||
false,
|
||||
null)
|
||||
.toString(StandardCharsets.UTF_8)
|
||||
@@ -165,18 +165,18 @@ class PackageResolversTest {
|
||||
fun `requires package zip to be an HTTPS URI`() {
|
||||
assertThatCode {
|
||||
resolver.getBytes(
|
||||
PackageAssetUri("package://localhost:12110/badPackageZipUrl@1.0.0#/Bug.pkl"),
|
||||
PackageAssetUri("package://localhost:0/badPackageZipUrl@1.0.0#/Bug.pkl"),
|
||||
false,
|
||||
null)
|
||||
}
|
||||
.hasMessage("Expected the zip asset for package `package://localhost:12110/badPackageZipUrl@1.0.0` to be an HTTPS URI, but got `ftp://wait/a/minute`.")
|
||||
.hasMessage("Expected the zip asset for package `package://localhost:0/badPackageZipUrl@1.0.0` to be an HTTPS URI, but got `ftp://wait/a/minute`.")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `throws if package checksum is invalid`() {
|
||||
val error = assertThrows<PackageLoadError> {
|
||||
resolver.getBytes(
|
||||
PackageAssetUri("package://localhost:12110/badChecksum@1.0.0#/Bug.pkl"),
|
||||
PackageAssetUri("package://localhost:0/badChecksum@1.0.0#/Bug.pkl"),
|
||||
false,
|
||||
null)
|
||||
}
|
||||
|
||||
@@ -46,23 +46,23 @@ class ProjectDependenciesResolverTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/birds@0.5.0",
|
||||
"uri": "projectpackage://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
"sha256": "${PackageServer.BIRDS_SHA}"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.1.0",
|
||||
"checksums": {
|
||||
"sha256": "a82e92e0c259591111d09d18a14f5ad66e2b6e13d827ee3e6f7ce06f5d0fbe0c"
|
||||
"sha256": "${PackageServer.FRUIT_1_1_SHA}"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/project3@1": {
|
||||
"package://localhost:0/project3@1": {
|
||||
"type": "local",
|
||||
"uri": "projectpackage://localhost:12110/project3@1.5.0",
|
||||
"uri": "projectpackage://localhost:0/project3@1.5.0",
|
||||
"path": "../project3"
|
||||
}
|
||||
}
|
||||
@@ -79,9 +79,9 @@ class ProjectDependenciesResolverTest {
|
||||
ProjectDependenciesResolver(project, packageResolver, System.err.writer()).resolve()
|
||||
}
|
||||
assertThat(e).hasMessage("""
|
||||
Computed checksum did not match declared checksum for dependency `package://localhost:12110/birds@0.5.0`.
|
||||
Computed checksum did not match declared checksum for dependency `package://localhost:0/birds@0.5.0`.
|
||||
|
||||
Computed: "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
|
||||
Computed: "${PackageServer.BIRDS_SHA}"
|
||||
Declared: "intentionally bogus value"
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
@@ -14,16 +14,16 @@ class ProjectDepsTest {
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/birds@0": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "package://localhost:12110/birds@0.5.0",
|
||||
"uri": "package://localhost:0/birds@0.5.0",
|
||||
"checksums": {
|
||||
"sha256": "abc123"
|
||||
}
|
||||
},
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "local",
|
||||
"uri": "package://localhost:12110/fruit@1.1.0",
|
||||
"uri": "package://localhost:0/fruit@1.1.0",
|
||||
"path": "../fruit"
|
||||
}
|
||||
}
|
||||
@@ -32,12 +32,12 @@ class ProjectDepsTest {
|
||||
|
||||
private val projectDeps = let {
|
||||
val projectDepsMap = EconomicMaps.of<CanonicalPackageUri, Dependency>(
|
||||
CanonicalPackageUri.of("package://localhost:12110/birds@0"), Dependency.RemoteDependency(
|
||||
PackageUri.create("package://localhost:12110/birds@0.5.0"),
|
||||
CanonicalPackageUri.of("package://localhost:0/birds@0"), Dependency.RemoteDependency(
|
||||
PackageUri.create("package://localhost:0/birds@0.5.0"),
|
||||
Checksums("abc123")
|
||||
),
|
||||
CanonicalPackageUri.of("package://localhost:12110/fruit@1"), Dependency.LocalDependency(
|
||||
PackageUri.create("package://localhost:12110/fruit@1.1.0"),
|
||||
CanonicalPackageUri.of("package://localhost:0/fruit@1"), Dependency.LocalDependency(
|
||||
PackageUri.create("package://localhost:0/fruit@1.1.0"),
|
||||
Path.of("../fruit")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -151,11 +151,11 @@ class ProjectTest {
|
||||
assertThatCode { evaluator.evaluate(ModuleSource.path(projectDir.resolve("bug.pkl"))) }
|
||||
.hasMessageStartingWith("""
|
||||
–– Pkl Error ––
|
||||
Cannot download package `package://localhost:12110/fruit@1.0.5` because the computed checksum for package metadata does not match the expected checksum.
|
||||
Cannot download package `package://localhost:0/fruit@1.0.5` because the computed checksum for package metadata does not match the expected checksum.
|
||||
|
||||
Computed checksum: "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
|
||||
Computed checksum: "${PackageServer.FRUIT_SHA}"
|
||||
Expected checksum: "intentionally bogus checksum"
|
||||
Asset URL: "https://localhost:12110/fruit@1.0.5"
|
||||
Asset URL: "https://localhost:0/fruit@1.0.5"
|
||||
|
||||
1 | import "@fruit/Fruit.pkl"
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -2,7 +2,7 @@ amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
checksums {
|
||||
sha256 = "intentionally bogus value"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@ amends "pkl:Project"
|
||||
dependencies {
|
||||
["fruit"] {
|
||||
// should fail because the checksum is invalid
|
||||
uri = "package://localhost:12110/fruit@1.0.5"
|
||||
uri = "package://localhost:0/fruit@1.0.5"
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:12110/fruit@1": {
|
||||
"package://localhost:0/fruit@1": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
|
||||
"uri": "projectpackage://localhost:0/fruit@1.0.5",
|
||||
"checksums": {
|
||||
"sha256": "intentionally bogus checksum"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:12110/birds@0.5.0"
|
||||
uri = "package://localhost:0/birds@0.5.0"
|
||||
}
|
||||
["project3"] = import("../project3/PklProject")
|
||||
}
|
||||
@@ -2,7 +2,7 @@ amends "pkl:Project"
|
||||
|
||||
package {
|
||||
name = "project3"
|
||||
baseUri = "package://localhost:12110/project3"
|
||||
baseUri = "package://localhost:0/project3"
|
||||
version = "1.5.0"
|
||||
// not actually used, just need to provide one so tests pass
|
||||
packageZipUrl = "https://bogus.value"
|
||||
@@ -10,6 +10,6 @@ package {
|
||||
|
||||
dependencies {
|
||||
["fruit"] {
|
||||
uri = "package://localhost:12110/fruit@1.1.0"
|
||||
uri = "package://localhost:0/fruit@1.1.0"
|
||||
}
|
||||
}
|
||||
@@ -4,5 +4,5 @@ package {
|
||||
name = "project4"
|
||||
version = "1.0.0"
|
||||
packageZipUrl = "https://bogus.value"
|
||||
baseUri = "package://localhost:12110/project4"
|
||||
baseUri = "package://localhost:0/project4"
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 123 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user