diff --git a/.arc-validate-results/arc_specification@2.0.0/badge.svg b/.arc-validate-results/arc_specification@2.0.0/badge.svg
deleted file mode 100644
index ec7c9d9..0000000
--- a/.arc-validate-results/arc_specification@2.0.0/badge.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
diff --git a/.arc-validate-results/arc_specification@2.0.0/validation_report.xml b/.arc-validate-results/arc_specification@2.0.0/validation_report.xml
deleted file mode 100644
index 10cef44..0000000
--- a/.arc-validate-results/arc_specification@2.0.0/validation_report.xml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/.arc-validate-results/arc_specification@2.0.0/validation_summary.json b/.arc-validate-results/arc_specification@2.0.0/validation_summary.json
deleted file mode 100644
index 5d80d17..0000000
--- a/.arc-validate-results/arc_specification@2.0.0/validation_summary.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Critical":{"HasFailures":true,"Total":17,"Passed":9,"Failed":8,"Errored":0},"NonCritical":{"HasFailures":false,"Total":0,"Passed":0,"Failed":0,"Errored":0},"ValidationPackage":{"Name":"arc_specification","Version":"2.0.0","Summary":"Validate whether an ARC conforms to Specification V2.0.0-draft","Description":"Validate whether an ARC conforms to Specification V2.0.0-draft. See the relevant spec at https://github.com/nfdi4plants/ARC-specification/blob/v2.0.0/ARC%20specification.md"}}
\ No newline at end of file
diff --git a/src/ARCExpect/ARCExpect.fsproj b/src/ARCExpect/ARCExpect.fsproj
index 620d6df..4a5a296 100644
--- a/src/ARCExpect/ARCExpect.fsproj
+++ b/src/ARCExpect/ARCExpect.fsproj
@@ -34,6 +34,6 @@
-
+
\ No newline at end of file
diff --git a/src/ARCExpect/RELEASE_NOTES.md b/src/ARCExpect/RELEASE_NOTES.md
index 7577dd4..0a63368 100644
--- a/src/ARCExpect/RELEASE_NOTES.md
+++ b/src/ARCExpect/RELEASE_NOTES.md
@@ -1,3 +1,9 @@
+### 4.0.0 - (Released 2024-06-21)
+
+- Support full semantic versions for ValidationPackageMetadata in the `ARCExpect` API.
+
+- Use SemVer prerelease suffix for `arc_specification @2.0.0-draft_`
+
### 3.0.1 - (Released 2024-04-30)
Update pinned dependencies
diff --git a/src/ARCExpect/SpecificationValidation/V2_0_0_Draft.fs b/src/ARCExpect/SpecificationValidation/V2_0_0_Draft.fs
index 85d2d32..b5290cf 100644
--- a/src/ARCExpect/SpecificationValidation/V2_0_0_Draft.fs
+++ b/src/ARCExpect/SpecificationValidation/V2_0_0_Draft.fs
@@ -558,7 +558,8 @@ module V2_0_0_Draft =
description = "Validate whether an ARC conforms to Specification V2.0.0-draft. See the relevant spec at https://github.com/nfdi4plants/ARC-specification/blob/v2.0.0/ARC%20specification.md",
majorVersion = 2,
minorVersion = 0,
- patchVersion = 0
+ patchVersion = 0,
+ PreReleaseVersionSuffix = "draft"
),
CriticalValidationCasesList = cases
)
\ No newline at end of file
diff --git a/src/ARCExpect/TopLevelAPI.fs b/src/ARCExpect/TopLevelAPI.fs
index 83d71f3..1b5fc9e 100644
--- a/src/ARCExpect/TopLevelAPI.fs
+++ b/src/ARCExpect/TopLevelAPI.fs
@@ -120,7 +120,7 @@ type Execute =
) =
fun (arcValidationPackage: ARCValidationPackage) ->
- let labelText = defaultArg BadgeLabelText arcValidationPackage.Metadata.Name
+ let labelText = defaultArg BadgeLabelText $"{arcValidationPackage.Metadata.Name}@{ValidationPackageMetadata.getSemanticVersionString arcValidationPackage.Metadata}"
let foldername = $"{arcValidationPackage.Metadata.Name}@{ValidationPackageMetadata.getSemanticVersionString arcValidationPackage.Metadata}"
diff --git a/src/ARCValidationPackages/ARCValidationPackages.fsproj b/src/ARCValidationPackages/ARCValidationPackages.fsproj
index 4f5ed3f..7fd8069 100644
--- a/src/ARCValidationPackages/ARCValidationPackages.fsproj
+++ b/src/ARCValidationPackages/ARCValidationPackages.fsproj
@@ -22,8 +22,8 @@
-
-
+
+
diff --git a/src/ARCValidationPackages/Domain.fs b/src/ARCValidationPackages/Domain.fs
index 538df69..1af7f2a 100644
--- a/src/ARCValidationPackages/Domain.fs
+++ b/src/ARCValidationPackages/Domain.fs
@@ -6,13 +6,6 @@ open System.Text.Json.Serialization
open AVPRIndex.Domain
open System.Runtime.CompilerServices
-
-module ValidationPackageMetadata =
- let getSemanticVersionString(m: ValidationPackageMetadata) = $"{m.MajorVersion}.{m.MinorVersion}.{m.PatchVersion}"
-
-module ValidationPackageIndex =
- let getSemanticVersionString(i: ValidationPackageIndex) = $"{i.Metadata.MajorVersion}.{i.Metadata.MinorVersion}.{i.Metadata.PatchVersion}"
-
///
/// represents the locally installed version of a validation package, e.g. the path to the local file and the date it was cached.
///
@@ -50,21 +43,6 @@ type CachedValidationPackage =
metadata = packageIndex.Metadata
)
- ///
- /// Creates a new ARCValidationPackage from a package name only, with the CacheDate set to the current or optionally a custom date, and the LocalPath set to the default preview cache folder or custom folder.
- ///
- ///
- ///
- ///
- static member ofPackageName (packageName: string, ?Date: System.DateTimeOffset, ?Path: string) =
- let path = defaultArg Path (Defaults.PACKAGE_CACHE_FOLDER_PREVIEW())
- CachedValidationPackage.create(
- fileName = packageName,
- cacheDate = (defaultArg Date System.DateTimeOffset.Now),
- localPath = (System.IO.Path.Combine(path, $"{packageName}.fsx").Replace("\\","/")),
- metadata = ValidationPackageMetadata()
- )
-
///
/// Creates a new ARCValidationPackage from a ValidationPackageMetadata, with the CacheDate set to the current or optionally a custom date, and the LocalPath set to the default release cache folder or custom folder.
///
@@ -72,10 +50,11 @@ type CachedValidationPackage =
/// Optional. The date to set the CacheDate to. Defaults to the current date.
static member ofPackageMetadata (packageMetadata: ValidationPackageMetadata, ?Date: System.DateTimeOffset, ?CacheFolder: string) =
let path = defaultArg CacheFolder (Defaults.PACKAGE_CACHE_FOLDER_RELEASE())
+ let filename = $"{packageMetadata.Name}@{ValidationPackageMetadata.getSemanticVersionString packageMetadata}.fsx"
CachedValidationPackage.create(
- fileName = packageMetadata.Name,
+ fileName = filename,
cacheDate = (defaultArg Date System.DateTimeOffset.Now),
- localPath = (System.IO.Path.Combine(path, $"{packageMetadata.Name}@{packageMetadata.MajorVersion}.{packageMetadata.MinorVersion}.{packageMetadata.PatchVersion}.fsx").Replace("\\","/")),
+ localPath = (System.IO.Path.Combine(path, filename).Replace("\\","/")),
metadata = packageMetadata
)
@@ -87,7 +66,7 @@ type CachedValidationPackage =
static member updateCacheDate (date: System.DateTimeOffset) (package: CachedValidationPackage) =
{package with CacheDate = date}
- static member getSemanticVersionString(vp: CachedValidationPackage) = $"{vp.Metadata.MajorVersion}.{vp.Metadata.MinorVersion}.{vp.Metadata.PatchVersion}";
+ static member getSemanticVersionString(vp: CachedValidationPackage) = ValidationPackageMetadata.getSemanticVersionString vp.Metadata
member this.PrettyPrint() =
- $" {this.Metadata.Name} @ version {this.Metadata.MajorVersion}.{this.Metadata.MinorVersion}.{this.Metadata.PatchVersion}{System.Environment.NewLine}{this.Metadata.Description}{System.Environment.NewLine}CacheDate: {this.CacheDate}{System.Environment.NewLine}Installed at: {this.LocalPath}{System.Environment.NewLine}"
\ No newline at end of file
+ $" {this.Metadata.Name} @ version {ValidationPackageMetadata.getSemanticVersionString this.Metadata}{System.Environment.NewLine}{this.Metadata.Description}{System.Environment.NewLine}CacheDate: {this.CacheDate}{System.Environment.NewLine}Installed at: {this.LocalPath}{System.Environment.NewLine}"
\ No newline at end of file
diff --git a/src/ARCValidationPackages/PackageCache.fs b/src/ARCValidationPackages/PackageCache.fs
index 84eb022..0800254 100644
--- a/src/ARCValidationPackages/PackageCache.fs
+++ b/src/ARCValidationPackages/PackageCache.fs
@@ -66,7 +66,18 @@ type PackageCache =
static member getLatestPackage (name: string) (cache: PackageCache) =
cache[name]
- |> Seq.maxBy (fun (kv:KeyValuePair) -> kv.Key)
+ // only get stable versions when suffixes are not supplied explicitly
+ |> Seq.filter (fun (kv:KeyValuePair) ->
+ let semver = SemVer.tryParse kv.Key
+ if semver.IsSome then
+ semver.Value.PreRelease = ""
+ && semver.Value.BuildMetadata = ""
+ else false
+ )
+ |> Seq.maxBy (fun (kv:KeyValuePair) ->
+ let semver = SemVer.tryParse kv.Key |> Option.get
+ semver.Major, semver.Minor, semver.Patch
+ )
|> fun x -> x.Value
static member getPackages (name: string) (cache: PackageCache) =
diff --git a/src/ARCValidationPackages/RELEASE_NOTES.md b/src/ARCValidationPackages/RELEASE_NOTES.md
index b84077d..2f67da9 100644
--- a/src/ARCValidationPackages/RELEASE_NOTES.md
+++ b/src/ARCValidationPackages/RELEASE_NOTES.md
@@ -1,4 +1,8 @@
-### 4.0.1 - (Released 2024-04-30)
+### 5.0.0 - (Released 2024-06-21)
+
+Support full semantic versions with suffixes
+
+### 4.0.1 - (Released 2024-04-30)
Update pinned dependencies
diff --git a/src/ARCValidationPackages/TopLevelAPI.fs b/src/ARCValidationPackages/TopLevelAPI.fs
index 1f54596..986d3c2 100644
--- a/src/ARCValidationPackages/TopLevelAPI.fs
+++ b/src/ARCValidationPackages/TopLevelAPI.fs
@@ -177,7 +177,7 @@ type Preview =
|> PackageCache.addPackage package
|> PackageCache.write(cacheFolder)
- Ok ($"installed preview package {package.FileName}@{ValidationPackageMetadata.getSemanticVersionString package.Metadata} at {package.LocalPath}")
+ Ok ($"installed preview package {package.FileName} at {package.LocalPath}")
with e ->
match e with
diff --git a/src/arc-validate/APIs/PackageAPI.fs b/src/arc-validate/APIs/PackageAPI.fs
index ecf95fc..b666f48 100644
--- a/src/arc-validate/APIs/PackageAPI.fs
+++ b/src/arc-validate/APIs/PackageAPI.fs
@@ -47,6 +47,13 @@ type PackageAPI =
let packageName = args.TryGetResult(PackageInstallArgs.Package).Value
let version = args.TryGetResult(PackageInstallArgs.Version)
+
+ if Verbose.IsSome then
+ if Verbose.Value then
+ if version.IsSome then
+ printfn $"""Installing package {packageName} {version.Value} from source {if isRelease then "'avpr.nfdi4plants.org'" else "'preview-index on GitHub'"} """
+ else
+ printfn $"""Installing package latest version of {packageName} from source {if isRelease then "'avpr.nfdi4plants.org'" else "'preview-index on GitHub'"} """
if isRelease then
match (AVPR.InstallPackage(avprCache, packageName, ?SemVer = version, ?Verbose = Verbose)) with
| Ok msg ->
diff --git a/src/arc-validate/arc-validate.fsproj b/src/arc-validate/arc-validate.fsproj
index 257006b..439fd62 100644
--- a/src/arc-validate/arc-validate.fsproj
+++ b/src/arc-validate/arc-validate.fsproj
@@ -26,8 +26,8 @@
-
-
+
+
diff --git a/tests/ARCValidationPackages.Tests/ARCValidationPackageTests.fs b/tests/ARCValidationPackages.Tests/ARCValidationPackageTests.fs
index 7f780f9..b79e3c9 100644
--- a/tests/ARCValidationPackages.Tests/ARCValidationPackageTests.fs
+++ b/tests/ARCValidationPackages.Tests/ARCValidationPackageTests.fs
@@ -12,10 +12,10 @@ let tests =
test "updateCacheDate" {
Expect.equal
(
- testValidationPackage1
+ CachedValidationPackage.Preview.testValidationPackage1
|> CachedValidationPackage.updateCacheDate testDate2
)
- testValidationPackage2
+ CachedValidationPackage.Preview.testValidationPackage2
"ARCValidationPackage cache date was not updated correctly."
}
test "ofPackageIndex" {
@@ -26,7 +26,7 @@ let tests =
Date = testDate2
)
)
- testValidationPackage2
+ CachedValidationPackage.Preview.testValidationPackage2
"ARCValidationPackage was not created correctly."
}
]
diff --git a/tests/ARCValidationPackages.Tests/ARCValidationPackages.Tests.fsproj b/tests/ARCValidationPackages.Tests/ARCValidationPackages.Tests.fsproj
index 34d5989..dc351e7 100644
--- a/tests/ARCValidationPackages.Tests/ARCValidationPackages.Tests.fsproj
+++ b/tests/ARCValidationPackages.Tests/ARCValidationPackages.Tests.fsproj
@@ -11,6 +11,7 @@
+
diff --git a/tests/ARCValidationPackages.Tests/AVPRAPITests.fs b/tests/ARCValidationPackages.Tests/AVPRAPITests.fs
index 5541d83..271937b 100644
--- a/tests/ARCValidationPackages.Tests/AVPRAPITests.fs
+++ b/tests/ARCValidationPackages.Tests/AVPRAPITests.fs
@@ -20,13 +20,11 @@ let ``AVPRAPI tests`` =
}
test "test_5_0_0 - CQCHookEndpoint addition" {
let vp = AVPR.api.GetPackageByNameAndVersion "test" "5.0.0"
- let script =
- vp.PackageContent
- |> Encoding.UTF8.GetString
- Expect.equal
- (script.ReplaceLineEndings("\n"))
- ReferenceObjects.testScriptContentAVPR_test_5_0_0
- $"repository content was not correct{System.Environment.NewLine}{script}"
+ Expect.AVPRClient.validationPackageEqual vp ReferenceObjects.AVPRClientDomain.ValidationPackage.testPackage_5_0_0
+ }
+ test "test_5_0_0-use+suffixes - SemVer addition" {
+ let vp = AVPR.api.GetPackageByNameAndVersion "test" "5.0.0-use+suffixes"
+ Expect.AVPRClient.validationPackageEqual vp ReferenceObjects.AVPRClientDomain.ValidationPackage.``testPackage_5_0_0-use+suffixes``
}
]
@@ -34,13 +32,33 @@ let ``AVPRAPI tests`` =
let indexedPackages = AVPR.api.GetAllPackages()
Expect.isTrue (indexedPackages |> Array.exists (fun package -> package.Name = "test")) "package index did not contain test script"
}
- test "downloadPackageScript test_3_0_0" {
- Expect.equal
- (
- AVPR.api.downloadPackageScript( "test", "3.0.0")
- |> fun content -> content.ReplaceLineEndings("\n")
- )
- ReferenceObjects.testScriptContentAVPR_test_3_0_0
- "script content was not correct"
- }
+ testList "downloadPackageScript" [
+ test "test_3_0_0" {
+ Expect.equal
+ (
+ AVPR.api.downloadPackageScript( "test", "3.0.0")
+ |> fun content -> content.ReplaceLineEndings("\n")
+ )
+ ReferenceObjects.testScriptContentAVPR_test_3_0_0
+ "script content was not correct"
+ }
+ test "test_5_0_0 - CQCHookEndpoint addition" {
+ Expect.equal
+ (
+ AVPR.api.downloadPackageScript( "test", "5.0.0")
+ |> fun content -> content.ReplaceLineEndings("\n")
+ )
+ ReferenceObjects.testScriptContentAVPR_test_5_0_0
+ "script content was not correct"
+ }
+ test "test_5_0_0-use+suffixes - SemVer addition" {
+ Expect.equal
+ (
+ AVPR.api.downloadPackageScript( "test", "5.0.0-use+suffixes")
+ |> fun content -> content.ReplaceLineEndings("\n")
+ )
+ ReferenceObjects.``testScriptContentAVPR_test_5_0_0-use+suffixes``
+ "script content was not correct"
+ }
+ ]
]
\ No newline at end of file
diff --git a/tests/ARCValidationPackages.Tests/DomainTests.fs b/tests/ARCValidationPackages.Tests/DomainTests.fs
new file mode 100644
index 0000000..e0c1bfb
--- /dev/null
+++ b/tests/ARCValidationPackages.Tests/DomainTests.fs
@@ -0,0 +1,95 @@
+module DomainTests
+
+open Expecto
+open ARCValidationPackages
+open System
+open System.IO
+
+open ReferenceObjects
+open Common.TestUtils
+open TestUtils
+
+[]
+let ``Domain tests`` =
+ testList "DomainTests" [
+ testList "CachedValidationPackage" [
+ test "create 3_0_0" {
+ let actual = CachedValidationPackage.create(
+ fileName = "test@3.0.0.fsx",
+ cacheDate = testDate3,
+ localPath = (Path.Combine(expected_package_cache_folder_path_preview, "test@3.0.0.fsx").Replace("\\","/")),
+ metadata = AVPRIndexDomain.ValidationPackageMetadata.testPackage_3_0_0_metadata
+ )
+ Expect.equal actual CachedValidationPackage.Preview.testPackage_3_0_0 "CachedValidationPackage was not created correctly."
+ }
+ test "create 5_0_0" {
+ let actual = CachedValidationPackage.create(
+ fileName = "test@5.0.0.fsx",
+ cacheDate = testDate3,
+ localPath = (Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0.fsx").Replace("\\","/")),
+ metadata = AVPRIndexDomain.ValidationPackageMetadata.testPackage_5_0_0_metadata
+ )
+ Expect.equal actual CachedValidationPackage.Preview.testPackage_5_0_0 "CachedValidationPackage was not created correctly."
+ }
+ test "create 5_0_0-use+suffixes" {
+ let actual = CachedValidationPackage.create(
+ fileName = "test@5.0.0-use+suffixes.fsx",
+ cacheDate = testDate3,
+ localPath = (Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0-use+suffixes.fsx").Replace("\\","/")),
+ metadata = AVPRIndexDomain.ValidationPackageMetadata.``testPackage_5_0_0-use+suffixes_metadata``
+ )
+ Expect.equal actual CachedValidationPackage.Preview.``testPackage_5_0_0-use+suffixes`` "CachedValidationPackage was not created correctly."
+ }
+ test "ofPackageIndex 3_0_0" {
+ let actual = CachedValidationPackage.ofPackageIndex(
+ packageIndex = AVPRIndexDomain.ValidationPackageIndex.testPackageIndex_3_0_0,
+ Date = testDate3
+ )
+ Expect.equal actual CachedValidationPackage.Preview.testPackage_3_0_0 "CachedValidationPackage was not created correctly."
+ }
+ test "ofPackageIndex 5_0_0" {
+ let actual = CachedValidationPackage.ofPackageIndex(
+ packageIndex = AVPRIndexDomain.ValidationPackageIndex.testPackageIndex_5_0_0,
+ Date = testDate3
+ )
+ Expect.equal actual CachedValidationPackage.Preview.testPackage_5_0_0 "CachedValidationPackage was not created correctly."
+ }
+ test "ofPackageIndex 5_0_0-use+suffixes" {
+ let actual = CachedValidationPackage.ofPackageIndex(
+ packageIndex = AVPRIndexDomain.ValidationPackageIndex.``testPackageIndex_5_0_0-use+suffixes``,
+ Date = testDate3
+ )
+ Expect.equal actual CachedValidationPackage.Preview.``testPackage_5_0_0-use+suffixes`` "CachedValidationPackage was not created correctly."
+ }
+ test "ofPackageMetadata 3_0_0" {
+ let actual = CachedValidationPackage.ofPackageMetadata(
+ packageMetadata = AVPRIndexDomain.ValidationPackageMetadata.testPackage_3_0_0_metadata,
+ Date = testDate3,
+ CacheFolder = expected_package_cache_folder_path_preview
+ )
+ Expect.equal actual CachedValidationPackage.Preview.testPackage_3_0_0 "CachedValidationPackage was not created correctly."
+ }
+ test "ofPackageMetadata 5_0_0" {
+ let actual = CachedValidationPackage.ofPackageMetadata(
+ packageMetadata = AVPRIndexDomain.ValidationPackageMetadata.testPackage_5_0_0_metadata,
+ Date = testDate3,
+ CacheFolder = expected_package_cache_folder_path_preview
+ )
+ Expect.equal actual CachedValidationPackage.Preview.testPackage_5_0_0 "CachedValidationPackage was not created correctly."
+ }
+ test "ofPackageMetadata 5_0_0-use+suffixes" {
+ let actual = CachedValidationPackage.ofPackageMetadata(
+ packageMetadata = AVPRIndexDomain.ValidationPackageMetadata.``testPackage_5_0_0-use+suffixes_metadata``,
+ Date = testDate3,
+ CacheFolder = expected_package_cache_folder_path_preview
+ )
+ Expect.equal actual CachedValidationPackage.Preview.``testPackage_5_0_0-use+suffixes`` "CachedValidationPackage was not created correctly."
+ }
+ test "updateCacheDate" {
+ ()
+ }
+ test "getSemanticVersionString" {
+ ()
+ }
+ ]
+ ]
\ No newline at end of file
diff --git a/tests/ARCValidationPackages.Tests/PackageCacheTests.fs b/tests/ARCValidationPackages.Tests/PackageCacheTests.fs
index c1c4bcf..e79ffbf 100644
--- a/tests/ARCValidationPackages.Tests/PackageCacheTests.fs
+++ b/tests/ARCValidationPackages.Tests/PackageCacheTests.fs
@@ -15,11 +15,11 @@ let tests =
test "createFromPackageList" {
Expect.packageCacheEqual
- (PackageCache([testValidationPackage1]))
+ (PackageCache([CachedValidationPackage.Preview.testValidationPackage1]))
(
let tmp = PackageCache()
let inner = new Dictionary()
- inner["1.0.0"] <- testValidationPackage1
+ inner["1.0.0"] <- CachedValidationPackage.Preview.testValidationPackage1
tmp["test"] <- inner
tmp
)
@@ -29,61 +29,90 @@ let tests =
Expect.packageCacheEqual
(
PackageCache()
- |> PackageCache.addPackage(testValidationPackage1)
+ |> PackageCache.addPackage(CachedValidationPackage.Preview.testValidationPackage1)
)
- testPackageCache1
+ PackageCache.Preview.testPackageCache1
} |> testSequenced
test "addOfPackageIndex" {
let actual =
PackageCache()
|> PackageCache.cachePackageOfIndex (testPackageIndex[0], testDate1)
- let expected = testPackageCache1
+ let expected = PackageCache.Preview.testPackageCache1
Expect.packageCacheEqual actual expected
}|> testSequenced
test "CopyViaConstructor" {
// copy and change the copy, this should not affect the original
- let tmp = PackageCache(testPackageCache1)
+ let tmp = PackageCache(PackageCache.Preview.testPackageCache1)
tmp |> PackageCache.removePackage "test" "1.0.0" |> ignore
- let actual = PackageCache([testValidationPackage1]) // this is the initial state of testPackageCache1
+ let actual = PackageCache([CachedValidationPackage.Preview.testValidationPackage1]) // this is the initial state of testPackageCache1
- Expect.packageCacheEqual actual testPackageCache1
+ Expect.packageCacheEqual actual PackageCache.Preview.testPackageCache1
} |> testSequenced
test "updateCacheDate" {
Expect.packageCacheEqual
(
- PackageCache(testPackageCache1)
- |> PackageCache.updateCacheDate testValidationPackage1.Metadata.Name (CachedValidationPackage.getSemanticVersionString testValidationPackage1) testDate2
+ PackageCache(PackageCache.Preview.testPackageCache1)
+ |> PackageCache.updateCacheDate CachedValidationPackage.Preview.testValidationPackage1.Metadata.Name (CachedValidationPackage.getSemanticVersionString CachedValidationPackage.Preview.testValidationPackage1) testDate2
)
- testPackageCache2
+ PackageCache.Preview.testPackageCache2
} |> testSequenced
test "can write json preview" {
deleteDefaultPackageCache() // make sure any cached file is deleted before testing that it can be written
- testPackageCache1 |> PackageCache.write(Defaults.PACKAGE_CACHE_FOLDER_PREVIEW())
+ PackageCache.Preview.testPackageCache1 |> PackageCache.write(Defaults.PACKAGE_CACHE_FOLDER_PREVIEW())
Expect.isTrue (File.Exists(expected_package_cache_file_path_preview)) "package cache file was not created"
} |> testSequenced
test "can write json release" {
//deleteDefaultPackageCache() // make sure any cached file is deleted before testing that it can be written
- testPackageCache1 |> PackageCache.write(Defaults.PACKAGE_CACHE_FOLDER_RELEASE())
+ PackageCache.Preview.testPackageCache1 |> PackageCache.write(Defaults.PACKAGE_CACHE_FOLDER_RELEASE())
Expect.isTrue (File.Exists(expected_package_cache_file_path_release)) "package cache file was not created"
} |> testSequenced
test "can read json preview" {
Expect.packageCacheEqual
(PackageCache.read(Defaults.PACKAGE_CACHE_FILE_PATH_PREVIEW()))
- testPackageCache1
+ PackageCache.Preview.testPackageCache1
} |> testSequenced
test "can read json release" {
Expect.packageCacheEqual
(PackageCache.read(Defaults.PACKAGE_CACHE_FILE_PATH_RELEASE()))
- testPackageCache1
+ PackageCache.Preview.testPackageCache1
+ } |> testSequenced
+
+ test "getLatestPackage returns latest stable package with no suffixes" {
+ let actual =
+ PackageCache([
+ CachedValidationPackage.Preview.``testPackage_5_0_0-use+suffixes``
+ CachedValidationPackage.Preview.testPackage_5_0_0
+ CachedValidationPackage.Preview.testPackage_3_0_0
+ ]) |> PackageCache.getLatestPackage "test"
+ Expect.cachedPackageEqualExceptDate actual CachedValidationPackage.Preview.testPackage_5_0_0
+ } |> testSequenced
+
+ test "getLatestPackage fails when no package is cached" {
+ Expect.throws (fun () -> PackageCache() |> PackageCache.getLatestPackage "test" |> ignore) "getLatestPackage did not fail"
+ } |> testSequenced
+
+ test "tryGetLatestPackage returns some latest stable package with no suffixes" {
+ let actual =
+ PackageCache([
+ CachedValidationPackage.Preview.``testPackage_5_0_0-use+suffixes``
+ CachedValidationPackage.Preview.testPackage_5_0_0
+ CachedValidationPackage.Preview.testPackage_3_0_0
+ ]) |> PackageCache.tryGetLatestPackage "test"
+ Expect.isSome actual ""
+ Expect.cachedPackageEqualExceptDate actual.Value CachedValidationPackage.Preview.testPackage_5_0_0
+ } |> testSequenced
+
+ test "tryGetLatestPackage returns None when no package is cached" {
+ Expect.isNone (PackageCache() |> PackageCache.tryGetLatestPackage "test") "tryGetLatestPackage was not None"
} |> testSequenced
])
\ No newline at end of file
diff --git a/tests/ARCValidationPackages.Tests/ReferenceObjects.fs b/tests/ARCValidationPackages.Tests/ReferenceObjects.fs
index 3bcbc90..5c3c36f 100644
--- a/tests/ARCValidationPackages.Tests/ReferenceObjects.fs
+++ b/tests/ARCValidationPackages.Tests/ReferenceObjects.fs
@@ -13,6 +13,9 @@ let testDate1 = System.DateTimeOffset.ParseExact("2023-08-15 10:00:00 +02:00", "
let testDate2 = System.DateTimeOffset.ParseExact("2023-08-15 11:00:00 +02:00", "yyyy-MM-dd HH:mm:ss zzz", System.Globalization.CultureInfo.InvariantCulture)
let testDate3 = System.DateTimeOffset.ParseExact("2024-02-22 09:00:17 +01:00", "yyyy-MM-dd HH:mm:ss zzz", System.Globalization.CultureInfo.InvariantCulture)
+let testScriptPath = "fixtures/testScript.fsx"
+let testScriptArgsPath = "fixtures/testScriptArgs.fsx"
+
let testPackageIndex =
[|
ValidationPackageIndex.create(
@@ -144,66 +147,158 @@ test_package
basePath = System.Environment.CurrentDirectory
)" .ReplaceLineEndings("\n")
-let testValidationPackage1 =
- CachedValidationPackage.create(
- "test@1.0.0.fsx",
- testDate1,
- (Path.Combine(expected_package_cache_folder_path_preview, "test@1.0.0.fsx").Replace("\\","/")),
- ValidationPackageMetadata.create("test", "this package is here for testing purposes only.", "this package is here for testing purposes only.", 1, 0, 0)
- )
+let ``testScriptContentAVPR_test_5_0_0-use+suffixes`` = "(*
+---
+Name: test
+MajorVersion: 5
+MinorVersion: 0
+PatchVersion: 0
+PreReleaseVersionSuffix: use
+BuildMetadataVersionSuffix: suffixes
+Publish: true
+Summary: this package is here for testing purposes only.
+Description: this package is here for testing purposes only.
+Authors:
+ - FullName: John Doe
+ Email: j@d.com
+ Affiliation: University of Nowhere
+ AffiliationLink: https://nowhere.edu
+ - FullName: Jane Doe
+ Email: jj@d.com
+ Affiliation: University of Somewhere
+ AffiliationLink: https://somewhere.edu
+Tags:
+ - Name: validation
+ - Name: my-package
+ - Name: thing
+ReleaseNotes: Use pre-release and build metadata version suffixes
+CQCHookEndpoint: https://avpr.nfdi4plants.org
+---
+*)
-let testValidationPackage2 =
- CachedValidationPackage.create(
- "test@1.0.0.fsx",
- testDate2,
- (Path.Combine(expected_package_cache_folder_path_preview, "test@1.0.0.fsx").Replace("\\","/")),
- ValidationPackageMetadata.create("test", "this package is here for testing purposes only.", "this package is here for testing purposes only.", 1, 0, 0)
- )
+printfn \"If you can read this in your console, you successfully executed test package v5.0.0-use+suffixes!\" ".ReplaceLineEndings("\n")
+
+module AVPRIndexDomain =
-let testValidationPackage3FullMetadata =
- CachedValidationPackage.create(
- "test@3.0.0.fsx",
- testDate3,
- (Path.Combine(expected_package_cache_folder_path_preview, "test@3.0.0.fsx").Replace("\\","/")),
- ValidationPackageMetadata.create(
- "test",
- "this package is here for testing purposes only.",
- "this package is here for testing purposes only.",
- 1,
- 0,
- 0,
- Publish = true,
+ module ValidationPackageMetadata =
+
+ let testPackage_3_0_0_metadata = ValidationPackageMetadata.create(
+ name = "test",
+ majorVersion = 3,
+ minorVersion = 0,
+ patchVersion = 0,
+ summary = "this package is here for testing purposes only.",
+ description = "this package is here for testing purposes only.",
Authors = [|
- Author.create(
+ AVPRIndex.Domain.Author.create(
fullName = "John Doe",
- email = "j@d.com",
+ Email = "j@d.com",
Affiliation = "University of Nowhere",
AffiliationLink = "https://nowhere.edu"
)
- Author.create(
+ AVPRIndex.Domain.Author.create(
fullName = "Jane Doe",
- email = "jj@d.com",
+ Email = "jj@d.com",
Affiliation = "University of Somewhere",
AffiliationLink = "https://somewhere.edu"
)
|],
Tags = [|
- OntologyAnnotation.create("validation")
- OntologyAnnotation.create("my-package")
- OntologyAnnotation.create("thing")
+ AVPRIndex.Domain.OntologyAnnotation.create(name = "validation")
+ AVPRIndex.Domain.OntologyAnnotation.create(name = "my-package")
+ AVPRIndex.Domain.OntologyAnnotation.create(name = "thing")
|],
- ReleaseNotes = "add authors and tags for further testing"
+ ReleaseNotes = "add authors and tags for further testing",
+ CQCHookEndpoint = ""
)
- )
-let testPackageCache1 = PackageCache([testValidationPackage1])
-let testPackageCache2 = PackageCache([testValidationPackage2])
+ let testPackage_5_0_0_metadata = ValidationPackageMetadata.create(
+ name = "test",
+ majorVersion = 5,
+ minorVersion = 0,
+ patchVersion = 0,
+ summary = "this package is here for testing purposes only.",
+ description = "this package is here for testing purposes only.",
+ Authors = [|
+ AVPRIndex.Domain.Author.create(
+ fullName = "John Doe",
+ Email = "j@d.com",
+ Affiliation = "University of Nowhere",
+ AffiliationLink = "https://nowhere.edu"
+ )
+ AVPRIndex.Domain.Author.create(
+ fullName = "Jane Doe",
+ Email = "jj@d.com",
+ Affiliation = "University of Somewhere",
+ AffiliationLink = "https://somewhere.edu"
+ )
+ |],
+ Tags = [|
+ AVPRIndex.Domain.OntologyAnnotation.create(name = "validation")
+ AVPRIndex.Domain.OntologyAnnotation.create(name = "my-package")
+ AVPRIndex.Domain.OntologyAnnotation.create(name = "thing")
+ |],
+ ReleaseNotes = "Use ARCExpect v3",
+ CQCHookEndpoint = "https://avpr.nfdi4plants.org"
+ )
+
+ let ``testPackage_5_0_0-use+suffixes_metadata`` = ValidationPackageMetadata.create(
+ name = "test",
+ majorVersion = 5,
+ minorVersion = 0,
+ patchVersion = 0,
+ summary = "this package is here for testing purposes only.",
+ description = "this package is here for testing purposes only.",
+ PreReleaseVersionSuffix = "use",
+ BuildMetadataVersionSuffix = "suffixes",
+ Authors = [|
+ AVPRIndex.Domain.Author.create(
+ fullName = "John Doe",
+ Email = "j@d.com",
+ Affiliation = "University of Nowhere",
+ AffiliationLink = "https://nowhere.edu"
+ )
+ AVPRIndex.Domain.Author.create(
+ fullName = "Jane Doe",
+ Email = "jj@d.com",
+ Affiliation = "University of Somewhere",
+ AffiliationLink = "https://somewhere.edu"
+ )
+ |],
+ Tags = [|
+ AVPRIndex.Domain.OntologyAnnotation.create(name = "validation")
+ AVPRIndex.Domain.OntologyAnnotation.create(name = "my-package")
+ AVPRIndex.Domain.OntologyAnnotation.create(name = "thing")
+ |],
+ ReleaseNotes = "Use pre-release and build metadata version suffixes",
+ CQCHookEndpoint = "https://avpr.nfdi4plants.org"
+ )
-let testScriptPath = "fixtures/testScript.fsx"
-let testScriptArgsPath = "fixtures/testScriptArgs.fsx"
+ module ValidationPackageIndex =
+
+ let testPackageIndex_3_0_0 = ValidationPackageIndex.create(
+ repoPath = "./StagingArea/test/test@3.0.0.fsx",
+ fileName = "test@3.0.0.fsx",
+ lastUpdated = testDate3,
+ contentHash = "384174B1D02FCA8255442306AC53FF80",
+ metadata = ValidationPackageMetadata.testPackage_3_0_0_metadata
+ )
+
+ let testPackageIndex_5_0_0 = ValidationPackageIndex.create(
+ repoPath = "./StagingArea/test/test@5.0.0.fsx",
+ fileName = "test@5.0.0.fsx",
+ lastUpdated = testDate3,
+ contentHash = "A39BDCECBAD67D4CCDBE9079E5A3E463",
+ metadata = ValidationPackageMetadata.testPackage_5_0_0_metadata
+ )
-let testScriptPackage = CachedValidationPackage.create("testScript", testDate1, testScriptPath, ValidationPackageMetadata())
-let testScriptArgsPackage = CachedValidationPackage.create("testScriptArgs", testDate1, testScriptArgsPath, ValidationPackageMetadata())
+ let ``testPackageIndex_5_0_0-use+suffixes`` = ValidationPackageIndex.create(
+ repoPath = "./StagingArea/test/test@5.0.0-use+suffixes.fsx",
+ fileName = "test@5.0.0-use+suffixes.fsx",
+ lastUpdated = testDate3,
+ contentHash = "4001D307AC13B7DB2039C85D7002C707",
+ metadata = ValidationPackageMetadata.``testPackage_5_0_0-use+suffixes_metadata``
+ )
module AVPRClientDomain =
module ValidationPackage =
@@ -212,6 +307,8 @@ module AVPRClientDomain =
MajorVersion = 3,
MinorVersion = 0,
PatchVersion = 0,
+ PreReleaseVersionSuffix = "",
+ BuildMetadataVersionSuffix = "",
Summary = "this package is here for testing purposes only.",
Description = "this package is here for testing purposes only.",
Authors = [|
@@ -236,4 +333,169 @@ module AVPRClientDomain =
ReleaseNotes = "add authors and tags for further testing",
PackageContent = System.Text.Encoding.UTF8.GetBytes testScriptContentAVPR_test_3_0_0,
CQCHookEndpoint = ""
- )
\ No newline at end of file
+ )
+
+ let testPackage_5_0_0 = AVPRClient.ValidationPackage(
+ Name = "test",
+ MajorVersion = 5,
+ MinorVersion = 0,
+ PatchVersion = 0,
+ PreReleaseVersionSuffix = "",
+ BuildMetadataVersionSuffix = "",
+ Summary = "this package is here for testing purposes only.",
+ Description = "this package is here for testing purposes only.",
+ Authors = [|
+ AVPRClient.Author(
+ FullName = "John Doe",
+ Email = "j@d.com",
+ Affiliation = "University of Nowhere",
+ AffiliationLink = "https://nowhere.edu"
+ )
+ AVPRClient.Author(
+ FullName = "Jane Doe",
+ Email = "jj@d.com",
+ Affiliation = "University of Somewhere",
+ AffiliationLink = "https://somewhere.edu"
+ )
+ |],
+ Tags = [|
+ AVPRClient.OntologyAnnotation(Name = "validation", TermAccessionNumber = "", TermSourceREF = "")
+ AVPRClient.OntologyAnnotation(Name = "my-package", TermAccessionNumber = "", TermSourceREF = "")
+ AVPRClient.OntologyAnnotation(Name = "thing", TermAccessionNumber = "", TermSourceREF = "")
+ |],
+ ReleaseNotes = "Use ARCExpect v3",
+ PackageContent = System.Text.Encoding.UTF8.GetBytes testScriptContentAVPR_test_5_0_0,
+ CQCHookEndpoint = "https://avpr.nfdi4plants.org"
+ )
+
+ let ``testPackage_5_0_0-use+suffixes`` = AVPRClient.ValidationPackage(
+ Name = "test",
+ MajorVersion = 5,
+ MinorVersion = 0,
+ PatchVersion = 0,
+ PreReleaseVersionSuffix = "use",
+ BuildMetadataVersionSuffix = "suffixes",
+ Summary = "this package is here for testing purposes only.",
+ Description = "this package is here for testing purposes only.",
+ Authors = [|
+ AVPRClient.Author(
+ FullName = "John Doe",
+ Email = "j@d.com",
+ Affiliation = "University of Nowhere",
+ AffiliationLink = "https://nowhere.edu"
+ )
+ AVPRClient.Author(
+ FullName = "Jane Doe",
+ Email = "jj@d.com",
+ Affiliation = "University of Somewhere",
+ AffiliationLink = "https://somewhere.edu"
+ )
+ |],
+ Tags = [|
+ AVPRClient.OntologyAnnotation(Name = "validation", TermAccessionNumber = "", TermSourceREF = "")
+ AVPRClient.OntologyAnnotation(Name = "my-package", TermAccessionNumber = "", TermSourceREF = "")
+ AVPRClient.OntologyAnnotation(Name = "thing", TermAccessionNumber = "", TermSourceREF = "")
+ |],
+ ReleaseNotes = "Use pre-release and build metadata version suffixes",
+ PackageContent = System.Text.Encoding.UTF8.GetBytes ``testScriptContentAVPR_test_5_0_0-use+suffixes``,
+ CQCHookEndpoint = "https://avpr.nfdi4plants.org"
+ )
+
+
+module CachedValidationPackage =
+
+ module Preview =
+
+ let testValidationPackage1 =
+ CachedValidationPackage.create(
+ "test@1.0.0.fsx",
+ testDate1,
+ (Path.Combine(expected_package_cache_folder_path_preview, "test@1.0.0.fsx").Replace("\\","/")),
+ ValidationPackageMetadata.create("test", "this package is here for testing purposes only.", "this package is here for testing purposes only.", 1, 0, 0)
+ )
+
+ let testValidationPackage2 =
+ CachedValidationPackage.create(
+ "test@1.0.0.fsx",
+ testDate2,
+ (Path.Combine(expected_package_cache_folder_path_preview, "test@1.0.0.fsx").Replace("\\","/")),
+ ValidationPackageMetadata.create("test", "this package is here for testing purposes only.", "this package is here for testing purposes only.", 1, 0, 0)
+ )
+
+ let testPackage_3_0_0 =
+ CachedValidationPackage.create(
+ fileName = "test@3.0.0.fsx",
+ cacheDate = testDate3,
+ localPath = (Path.Combine(expected_package_cache_folder_path_preview, "test@3.0.0.fsx").Replace("\\","/")),
+ metadata = AVPRIndexDomain.ValidationPackageMetadata.testPackage_3_0_0_metadata
+
+ )
+
+ let testPackage_5_0_0 =
+ CachedValidationPackage.create(
+ fileName = "test@5.0.0.fsx",
+ cacheDate = testDate3,
+ localPath = (Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0.fsx").Replace("\\","/")),
+ metadata = AVPRIndexDomain.ValidationPackageMetadata.testPackage_5_0_0_metadata
+ )
+
+ let ``testPackage_5_0_0-use+suffixes`` =
+ CachedValidationPackage.create(
+ fileName = "test@5.0.0-use+suffixes.fsx",
+ cacheDate = testDate3,
+ localPath = (Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0-use+suffixes.fsx").Replace("\\","/")),
+ metadata = AVPRIndexDomain.ValidationPackageMetadata.``testPackage_5_0_0-use+suffixes_metadata``
+ )
+
+ module AVPR =
+
+ let testValidationPackage1 =
+ CachedValidationPackage.create(
+ "test@1.0.0.fsx",
+ testDate1,
+ (Path.Combine(expected_package_cache_folder_path_release, "test@1.0.0.fsx").Replace("\\","/")),
+ ValidationPackageMetadata.create("test", "this package is here for testing purposes only.", "this package is here for testing purposes only.", 1, 0, 0)
+ )
+
+ let testValidationPackage2 =
+ CachedValidationPackage.create(
+ "test@1.0.0.fsx",
+ testDate2,
+ (Path.Combine(expected_package_cache_folder_path_release, "test@1.0.0.fsx").Replace("\\","/")),
+ ValidationPackageMetadata.create("test", "this package is here for testing purposes only.", "this package is here for testing purposes only.", 1, 0, 0)
+ )
+
+ let testPackage_3_0_0 =
+ CachedValidationPackage.create(
+ fileName = "test@3.0.0.fsx",
+ cacheDate = testDate3,
+ localPath = (Path.Combine(expected_package_cache_folder_path_release, "test@3.0.0.fsx").Replace("\\","/")),
+ metadata = AVPRIndexDomain.ValidationPackageMetadata.testPackage_3_0_0_metadata
+
+ )
+
+ let testPackage_5_0_0 =
+ CachedValidationPackage.create(
+ fileName = "test@5.0.0.fsx",
+ cacheDate = testDate3,
+ localPath = (Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0.fsx").Replace("\\","/")),
+ metadata = AVPRIndexDomain.ValidationPackageMetadata.testPackage_5_0_0_metadata
+ )
+
+ let ``testPackage_5_0_0-use+suffixes`` =
+ CachedValidationPackage.create(
+ fileName = "test@5.0.0-use+suffixes.fsx",
+ cacheDate = testDate3,
+ localPath = (Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0-use+suffixes.fsx").Replace("\\","/")),
+ metadata = AVPRIndexDomain.ValidationPackageMetadata.``testPackage_5_0_0-use+suffixes_metadata``
+ )
+
+ let testScriptPackage = CachedValidationPackage.create("testScript", testDate1, testScriptPath, ValidationPackageMetadata())
+ let testScriptArgsPackage = CachedValidationPackage.create("testScriptArgs", testDate1, testScriptArgsPath, ValidationPackageMetadata())
+
+module PackageCache =
+
+ module Preview =
+
+ let testPackageCache1 = PackageCache([CachedValidationPackage.Preview.testValidationPackage1])
+ let testPackageCache2 = PackageCache([CachedValidationPackage.Preview.testValidationPackage2])
diff --git a/tests/ARCValidationPackages.Tests/ScriptExecutionTests.fs b/tests/ARCValidationPackages.Tests/ScriptExecutionTests.fs
index 264d2e3..af2ed1f 100644
--- a/tests/ARCValidationPackages.Tests/ScriptExecutionTests.fs
+++ b/tests/ARCValidationPackages.Tests/ScriptExecutionTests.fs
@@ -43,28 +43,28 @@ let ``ScriptExecution tests`` =
testList "ARCValidationpackages" [
test "can execute script from package without errors" {
Expect.equal
- (ScriptExecution.runPackageScript testScriptPackage).ExitCode
+ (ScriptExecution.runPackageScript CachedValidationPackage.testScriptPackage).ExitCode
0
"script execution did not run without errors."
}
test "script from package prints message" {
Expect.sequenceEqual
- (ScriptExecution.runPackageScript testScriptPackage).Messages
+ (ScriptExecution.runPackageScript CachedValidationPackage.testScriptPackage).Messages
["Hello, World!"]
"script execution did not print correct mesages."
}
test "can execute script from package with args without errors" {
Expect.equal
- (ScriptExecution.runPackageScriptWithArgs testScriptArgsPackage [|"hello"; "world"|]).ExitCode
+ (ScriptExecution.runPackageScriptWithArgs CachedValidationPackage.testScriptArgsPackage [|"hello"; "world"|]).ExitCode
0
"script execution did not run without errors."
}
test "script from package with args prints message" {
Expect.sequenceEqual
- (ScriptExecution.runPackageScriptWithArgs testScriptArgsPackage [|"hello"; "world"|]).Messages
+ (ScriptExecution.runPackageScriptWithArgs CachedValidationPackage.testScriptArgsPackage [|"hello"; "world"|]).Messages
["""args: [|"hello"; "world"|]"""]
"script execution did not print correct mesages."
}
diff --git a/tests/ARCValidationPackages.Tests/TestUtils.fs b/tests/ARCValidationPackages.Tests/TestUtils.fs
index 3ee9861..bba3d51 100644
--- a/tests/ARCValidationPackages.Tests/TestUtils.fs
+++ b/tests/ARCValidationPackages.Tests/TestUtils.fs
@@ -62,6 +62,12 @@ module Expect =
Expect.sequenceEqual expectedKeysSorted actualKeysSorted $"Keys were not equal."
Expect.sequenceEqual zippedValuesActual zippedValuesExpected "Values were not equal."
+ let cachedPackageEqualExceptDate (actual:CachedValidationPackage) (expected:CachedValidationPackage) =
+ Expect.equal actual.Metadata expected.Metadata "CachedValidationPackage Metadata not equal"
+ Expect.equal actual.FileName expected.FileName "CachedValidationPackage FileName not equal"
+ Expect.equal actual.LocalPath expected.LocalPath "CachedValidationPackage PackageName not equal"
+
+
module AVPRClient =
let authorEqual (actual:AVPRClient.Author) (expected:AVPRClient.Author) =
@@ -81,6 +87,8 @@ module Expect =
Expect.equal actual.MajorVersion expected.MajorVersion "AVPRClient.ValidationPackage MajorVersion not equal"
Expect.equal actual.MinorVersion expected.MinorVersion "AVPRClient.ValidationPackage MinorVersion not equal"
Expect.equal actual.PatchVersion expected.PatchVersion "AVPRClient.ValidationPackage PatchVersion not equal"
+ Expect.equal actual.PreReleaseVersionSuffix expected.PreReleaseVersionSuffix "AVPRClient.PreReleaseVersionSuffix PatchVersion not equal"
+ Expect.equal actual.BuildMetadataVersionSuffix expected.BuildMetadataVersionSuffix "AVPRClient.ValidationPackage BuildMetadataVersionSuffix not equal"
Expect.equal actual.ReleaseNotes expected.ReleaseNotes "AVPRClient.ValidationPackage ReleaseNotes not equal"
Expect.equal actual.CQCHookEndpoint expected.CQCHookEndpoint "AVPRClient.ValidationPackage CQCHookEndpoint not equal"
@@ -93,7 +101,7 @@ module Expect =
Expect.sequenceEqual expected.Tags expected.Tags "AVPRClient.ValidationPackage Tags not equal"
Expect.sequenceEqual expected.PackageContent expected.PackageContent "AVPRClient.ValidationPackage PackageContent not equal"
-
+
module Result =
diff --git a/tests/ARCValidationPackages.Tests/TopLevelAPITests.fs b/tests/ARCValidationPackages.Tests/TopLevelAPITests.fs
index 169c4aa..0a96c28 100644
--- a/tests/ARCValidationPackages.Tests/TopLevelAPITests.fs
+++ b/tests/ARCValidationPackages.Tests/TopLevelAPITests.fs
@@ -147,7 +147,7 @@ let ``Toplevel API tests`` =
])
testSequenced (testList "AVPR API" [
- testSequenced (testList "SaveAndCachePackage" [
+ testSequenced (testList "SaveAndCachePackage test_3_0_0" [
// here, wee need persistent config and caches across the tests instead of a fixture for each test case
resetConfigEnvironment()
let _, avprCache, _ = Result.okValue (API.Common.GetSyncedConfigAndCache(?Token = get_gh_api_token()))
@@ -159,10 +159,57 @@ let ``Toplevel API tests`` =
avprCache
|> Expect.packageCacheContainsPackage "test" "3.0.0"
}
+ test "cached package is correct after running SaveAndCachePackage" {
+ let actual = avprCache |> PackageCache.getPackage "test" "3.0.0"
+ Expect.cachedPackageEqualExceptDate actual CachedValidationPackage.AVPR.testPackage_3_0_0
+ }
test "package exists after running SaveAndCachePackage" {
Expect.isTrue (File.Exists (Path.Combine(expected_package_cache_folder_path_release, "test@3.0.0.fsx"))) $"test@3.0.0.fsx did not exist at {expected_package_cache_folder_path_release}"
}
])
+
+ testSequenced (testList "SaveAndCachePackage test_5_0_0" [
+ // here, wee need persistent config and caches across the tests instead of a fixture for each test case
+ resetConfigEnvironment()
+ let _, avprCache, _ = Result.okValue (API.Common.GetSyncedConfigAndCache(?Token = get_gh_api_token()))
+
+ test "SaveAndCachePackage returns OK" {
+ Expect.isOk (API.AVPR.SaveAndCachePackage(avprCache, "test", packageVersion = "5.0.0" )) "SaveAndCachePackage did not return OK"
+ }
+ test "package is cached after running SaveAndCachePackage" {
+ avprCache
+ |> Expect.packageCacheContainsPackage "test" "5.0.0"
+ }
+ test "cached package is correct after running SaveAndCachePackage" {
+ let actual = avprCache |> PackageCache.getPackage "test" "5.0.0"
+ Expect.cachedPackageEqualExceptDate actual CachedValidationPackage.AVPR.testPackage_5_0_0
+ }
+ test "package exists after running SaveAndCachePackage" {
+ Expect.isTrue (File.Exists (Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0.fsx"))) $"test@5.0.0.fsx did not exist at {expected_package_cache_folder_path_release}"
+ }
+ ])
+
+ testSequenced (testList "SaveAndCachePackage test_5_0_0-use+suffixes" [
+ // here, wee need persistent config and caches across the tests instead of a fixture for each test case
+ resetConfigEnvironment()
+ let _, avprCache, _ = Result.okValue (API.Common.GetSyncedConfigAndCache(?Token = get_gh_api_token()))
+
+ test "SaveAndCachePackage returns OK" {
+ Expect.isOk (API.AVPR.SaveAndCachePackage(avprCache, "test", packageVersion = "5.0.0-use+suffixes" )) "SaveAndCachePackage did not return OK"
+ }
+ test "package is cached after running SaveAndCachePackage" {
+ avprCache
+ |> Expect.packageCacheContainsPackage "test" "5.0.0-use+suffixes"
+ }
+ test "cached package is correct after running SaveAndCachePackage" {
+ let actual = avprCache |> PackageCache.getPackage "test" "5.0.0-use+suffixes"
+ Expect.cachedPackageEqualExceptDate actual CachedValidationPackage.AVPR.``testPackage_5_0_0-use+suffixes``
+ }
+ test "package exists after running SaveAndCachePackage" {
+ Expect.isTrue (File.Exists (Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0-use+suffixes.fsx"))) $"test@5.0.0-use+suffixes.fsx did not exist at {expected_package_cache_folder_path_release}"
+ }
+ ])
+
testSequenced (testList "InstallPackage" [
// here, wee need persistent config and caches across the tests instead of a fixture for each test case
resetConfigEnvironment()
diff --git a/tests/FSharpConsole/FSharpConsole.fsproj b/tests/FSharpConsole/FSharpConsole.fsproj
index 5be3eb8..b7a0f06 100644
--- a/tests/FSharpConsole/FSharpConsole.fsproj
+++ b/tests/FSharpConsole/FSharpConsole.fsproj
@@ -12,6 +12,7 @@
+
diff --git a/tests/FSharpConsole/Program.fs b/tests/FSharpConsole/Program.fs
index 95db449..c97be7c 100644
--- a/tests/FSharpConsole/Program.fs
+++ b/tests/FSharpConsole/Program.fs
@@ -1,15 +1,10 @@
-// For more information see https://aka.ms/fsharp-console-apps
-open ARCValidationPackages
+open ARCValidate
+open ARCValidate.CLICommands
-open ARCValidationPackages
+let parser = ARCValidateCommand.createParser()
-let token =
- let t = System.Environment.GetEnvironmentVariable("ARC_VALIDATE_GITHUB_API_TEST_TOKEN")
- if isNull(t) then None else Some t
+let args = parser.Parse(inputs = [|"--verbose";"package";"install";"test"|])
-let configPath = @"C:/Users/schne/Desktop/lol/test.json"
-let cacheFolder = @"C:/Users/schne/Desktop/lol/cache"
+printfn "%A" args
-let syncResult = API.Common.GetSyncedConfigAndCache(ConfigPath = configPath, CacheFolderPreview = cacheFolder, ?Token = token)
-
-printfn "%A" syncResult
\ No newline at end of file
+ARCValidate.CommandHandling.handleARCValidateCommand true None (args.GetSubCommand())
\ No newline at end of file
diff --git a/tests/arc-validate.Tests/CLITests/PackageCommandTests.fs b/tests/arc-validate.Tests/CLITests/PackageCommandTests.fs
index 8290796..10b7079 100644
--- a/tests/arc-validate.Tests/CLITests/PackageCommandTests.fs
+++ b/tests/arc-validate.Tests/CLITests/PackageCommandTests.fs
@@ -18,7 +18,7 @@ open JUnit
[]
let ``PackageCommand CLI Tests`` =
testSequenced (testList "arc-validate package" [
- testSequenced (testList "preview" [
+ testSequenced (testList "source: preview index" [
testSequenced (testList "list" [
yield!
testFixture (Fixtures.withToolExecution
@@ -53,8 +53,8 @@ let ``PackageCommand CLI Tests`` =
"Package script has correct content" ,
fun tool args proc ->
Expect.equal
- (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_preview, "test@1.0.0.fsx")).ReplaceLineEndings())
- test_package_script_content_v1
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_preview, "test@1.0.0.fsx")).ReplaceLineEndings("\n"))
+ test_package_script_content_v1_0_0
(ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
]
])
@@ -123,8 +123,8 @@ let ``PackageCommand CLI Tests`` =
"Package script has correct content" ,
fun tool args proc ->
Expect.equal
- (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_preview, "test@2.0.0.fsx")).ReplaceLineEndings())
- test_package_script_content_v2
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_preview, "test@2.0.0.fsx")).ReplaceLineEndings("\n"))
+ test_package_script_content_v2_0_0
(ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
]
])
@@ -174,6 +174,216 @@ let ``PackageCommand CLI Tests`` =
fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("test @ version 2.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did contain the package" proc tool args)
]
])
+ testSequenced (testList "install test v3" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "3.0.0"; "--preview"|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_preview}." tool args)
+ "Cache exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_preview}." tool args)
+ "Package script exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@3.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not installed at expected location." tool args)
+ "Package script has correct content" ,
+ fun tool args proc ->
+ Expect.equal
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_preview, "test@3.0.0.fsx")).ReplaceLineEndings("\n"))
+ test_package_script_content_v3_0_0
+ (ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
+ ]
+ ])
+ testSequenced (testList "list v3" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after install)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is listed (after install)" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("test @ version 3.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did not contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "uninstall test v3" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "uninstall"; "test"; "--preview"|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder still exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_preview}." tool args)
+ "Cache still exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_preview}." tool args)
+ "test package script does not exist anymore" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@3.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not uninstalled at expected location." tool args)
+ ]
+ ])
+ testSequenced (testList "list v3" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after uninstall)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is not listed (after uninstall)" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("test @ version 3.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "install test v5" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "5.0.0"; "--preview"|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_preview}." tool args)
+ "Cache exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_preview}." tool args)
+ "Package script exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not installed at expected location." tool args)
+ "Package script has correct content" ,
+ fun tool args proc ->
+ Expect.equal
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0.fsx")).ReplaceLineEndings("\n"))
+ test_package_script_content_v5_0_0
+ (ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
+ ]
+ ])
+ testSequenced (testList "list v5" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after install)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is listed (after install)" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("test @ version 5.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did not contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "uninstall test v5" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "uninstall"; "test"; "--preview"|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder still exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_preview}." tool args)
+ "Cache still exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_preview}." tool args)
+ "test package script does not exist anymore" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not uninstalled at expected location." tool args)
+ ]
+ ])
+ testSequenced (testList "list v5" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after uninstall)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is not listed (after uninstall)" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("test @ version 5.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "install test v5-use+suffixes" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "5.0.0-use+suffixes"; "--preview"|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_preview}." tool args)
+ "Cache exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_preview}." tool args)
+ "Package script exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0-use+suffixes.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not installed at expected location." tool args)
+ "Package script has correct content" ,
+ fun tool args proc ->
+ Expect.equal
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0-use+suffixes.fsx")).ReplaceLineEndings("\n"))
+ ``test_package_script_content_v5_0_0-use+suffixes``
+ (ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
+ ]
+ ])
+ testSequenced (testList "list v5-use+suffixes" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after install)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is listed (after install)" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("test @ version 5.0.0-use+suffixes")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did not contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "uninstall test v5-use+suffixes" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "uninstall"; "test"; "--preview"|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder still exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_preview}." tool args)
+ "Cache still exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_preview)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_preview}." tool args)
+ "test package script does not exist anymore" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0-use+suffixes.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not uninstalled at expected location." tool args)
+ ]
+ ])
+ testSequenced (testList "list v5-use+suffixes" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after uninstall)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is not listed (after uninstall)" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("test @ version 5.0.0-use+suffixes")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did contain the package" proc tool args)
+ ]
+ ])
testSequenced (testList "update-index" [
yield!
testFixture (Fixtures.withToolExecution
@@ -187,7 +397,7 @@ let ``PackageCommand CLI Tests`` =
]
])
])
- testSequenced (testList "avpr" [
+ testSequenced (testList "source: AVPR" [
testSequenced (testList "list" [
yield!
testFixture (Fixtures.withToolExecution
@@ -222,8 +432,8 @@ let ``PackageCommand CLI Tests`` =
"Package script has correct content" ,
fun tool args proc ->
Expect.equal
- (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_release, "test@1.0.0.fsx")).ReplaceLineEndings())
- test_package_script_content_v1
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_release, "test@1.0.0.fsx")).ReplaceLineEndings("\n"))
+ test_package_script_content_v1_0_0
(ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
]
])
@@ -292,8 +502,8 @@ let ``PackageCommand CLI Tests`` =
"Package script has correct content" ,
fun tool args proc ->
Expect.equal
- (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_release, "test@2.0.0.fsx")).ReplaceLineEndings())
- test_package_script_content_v2
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_release, "test@2.0.0.fsx")).ReplaceLineEndings("\n"))
+ test_package_script_content_v2_0_0
(ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
]
])
@@ -343,5 +553,215 @@ let ``PackageCommand CLI Tests`` =
fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("test @ version 2.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did contain the package" proc tool args)
]
])
+ testSequenced (testList "install test v3" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "3.0.0"|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_release}." tool args)
+ "Cache exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_release}." tool args)
+ "Package script exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@3.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not installed at expected location." tool args)
+ "Package script has correct content" ,
+ fun tool args proc ->
+ Expect.equal
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_release, "test@3.0.0.fsx")).ReplaceLineEndings("\n"))
+ test_package_script_content_v3_0_0
+ (ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
+ ]
+ ])
+ testSequenced (testList "list v3" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after install)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is listed (after install)" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("test @ version 3.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did not contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "uninstall test v3" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "uninstall"; "test";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder still exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_release}." tool args)
+ "Cache still exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_release}." tool args)
+ "test package script does not exist anymore" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@3.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not uninstalled at expected location." tool args)
+ ]
+ ])
+ testSequenced (testList "list v3" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after uninstall)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is not listed (after uninstall)" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("test @ version 3.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "install test v5" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "5.0.0"|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_release}." tool args)
+ "Cache exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_release}." tool args)
+ "Package script exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not installed at expected location." tool args)
+ "Package script has correct content" ,
+ fun tool args proc ->
+ Expect.equal
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0.fsx")).ReplaceLineEndings("\n"))
+ test_package_script_content_v5_0_0
+ (ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
+ ]
+ ])
+ testSequenced (testList "list v5" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after install)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is listed (after install)" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("test @ version 5.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did not contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "uninstall test v5" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "uninstall"; "test";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder still exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_release}." tool args)
+ "Cache still exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_release}." tool args)
+ "test package script does not exist anymore" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not uninstalled at expected location." tool args)
+ ]
+ ])
+ testSequenced (testList "list v5" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after uninstall)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is not listed (after uninstall)" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("test @ version 5.0.0")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "install test v5-use+suffixes" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "5.0.0-use+suffixes"|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_release}." tool args)
+ "Cache exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_release}." tool args)
+ "Package script exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0-use+suffixes.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not installed at expected location." tool args)
+ "Package script has correct content" ,
+ fun tool args proc ->
+ Expect.equal
+ (File.ReadAllText(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0-use+suffixes.fsx")).ReplaceLineEndings("\n"))
+ ``test_package_script_content_v5_0_0-use+suffixes``
+ (ErrorMessage.withCLIDiagnostics $"Package script did not have correct content" tool args)
+ ]
+ ])
+ testSequenced (testList "list v5-use+suffixes" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after install)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is listed (after install)" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("test @ version 5.0.0-use+suffixes")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did not contain the package" proc tool args)
+ ]
+ ])
+ testSequenced (testList "uninstall test v5-use+suffixes" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "uninstall"; "test";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "Cache folder still exists" ,
+ fun tool args proc -> Expect.isTrue (Directory.Exists(expected_package_cache_folder_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache folder was not created at {expected_package_cache_folder_path_release}." tool args)
+ "Cache still exists" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(expected_package_cache_file_path_release)) (ErrorMessage.withCLIDiagnostics $"package cache was not created at {expected_package_cache_file_path_release}." tool args)
+ "test package script does not exist anymore" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0-use+suffixes.fsx"))) (ErrorMessage.withCLIDiagnostics $"package file was not uninstalled at expected location." tool args)
+ ]
+ ])
+ testSequenced (testList "list v5-use+suffixes" [
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "list";|]
+ (get_gh_api_token())
+ ) [
+ "Exit code is 0 (after uninstall)" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args)
+ "test package is not listed (after uninstall)" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("test @ version 5.0.0-use+suffixes")) (ErrorMessage.withProcessDiagnostics $"Console output {proc.Result.Output} did contain the package" proc tool args)
+ ]
+ ])
])
])
\ No newline at end of file
diff --git a/tests/arc-validate.Tests/CLITests/ValidateCommandTests.fs b/tests/arc-validate.Tests/CLITests/ValidateCommandTests.fs
index 3c1f0af..687ccc6 100644
--- a/tests/arc-validate.Tests/CLITests/ValidateCommandTests.fs
+++ b/tests/arc-validate.Tests/CLITests/ValidateCommandTests.fs
@@ -19,7 +19,7 @@ open JUnit
[]
let ``ValidateCommand CLI Tests`` =
testSequenced (testList "arc-validate validate" [
- testSequenced (testList "preview ARCExpect < 2" [
+ testSequenced (testList "source: preview index" [
testSequenced (testList "package test version 2" [
// run:
// - arc-validate --verbose package install test -v 2.0.0 --preview
@@ -31,9 +31,13 @@ let ``ValidateCommand CLI Tests`` =
[|"--verbose"; "package"; "install"; "test"; "-v"; "2.0.0"; "--preview"|]
(get_gh_api_token())
) [
- "Package script exists in preview cache after running package install test" ,
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed preview package test@2.0.0.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in preview cache after running package install test" ,
fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@2.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
- "Package script does not exist in avpr cache after running package install test" ,
+ "Install: Package script does not exist in avpr cache after running package install test" ,
fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@2.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
]
@@ -44,19 +48,138 @@ let ``ValidateCommand CLI Tests`` =
[|"--verbose"; "validate"; "-p"; "test"; "-v"; "2.0.0"; "--preview"; "-i"; "fixtures/arcs/inveniotestarc"|]
(get_gh_api_token())
) [
- "Exit code is 0" ,
+ "Validate: Exit code is 0" ,
fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
- "Console output does not indicate that package is not installed" ,
+ "Validate: Console output does not indicate that package is not installed" ,
fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
- "Console Output is correct" ,
+ "Validate: Console Output is correct" ,
fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed test package v2.0.0!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
- "Ouptput files exist",
+ "Validate: Ouptput files exist",
+ fun tool args proc ->
+ Expect.isTrue (Directory.Exists(".arc-validate-results")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ ]
+ ])
+ testSequenced (testList "package test version 3_0_0" [
+ // run:
+ // - arc-validate --verbose package install test -v 3.0.0 --preview
+ // - arc-validate validate -p test -v 3.0.0 --preview -i fixtures/arcs/inveniotestarc
+ yield!
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "3.0.0"; "--preview"|]
+ (get_gh_api_token())
+ ) [
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed preview package test@3.0.0.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in preview cache after running package install test" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@3.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+ "Install: Package script does not exist in avpr cache after running package install test" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@3.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+
+ ]
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "validate"; "-p"; "test"; "-v"; "3.0.0"; "--preview"; "-i"; "fixtures/arcs/inveniotestarc"|]
+ (get_gh_api_token())
+ ) [
+ "Validate: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Validate: Console output does not indicate that package is not installed" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Console Output is correct" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed test package v3.0.0!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Ouptput files exist",
fun tool args proc ->
Expect.isTrue (Directory.Exists(".arc-validate-results")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results does not exist in {System.Environment.CurrentDirectory}" proc tool args )
Expect.isTrue (File.Exists(".arc-validate-results/test/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
Expect.isTrue (File.Exists(".arc-validate-results/test/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
]
])
+ testSequenced (testList "package test version 5_0_0" [
+ // run:
+ // - arc-validate --verbose package install test -v 5.0.0 --preview
+ // - arc-validate validate -p test -v 5.0.0 --preview -i fixtures/arcs/inveniotestarc
+ yield!
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "5.0.0"; "--preview"|]
+ (get_gh_api_token())
+ ) [
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed preview package test@5.0.0.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in preview cache after running package install test" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+ "Install: Package script does not exist in avpr cache after running package install test" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+
+ ]
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "validate"; "-p"; "test"; "-v"; "5.0.0"; "--preview"; "-i"; "fixtures/arcs/inveniotestarc"|]
+ (get_gh_api_token())
+ ) [
+ "Validate: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Validate: Console output does not indicate that package is not installed" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Console Output is correct" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed test package v5.0.0!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Ouptput files exist",
+ fun tool args proc ->
+ Expect.isTrue (Directory.Exists(".arc-validate-results")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test@5.0.0/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test@5.0.0/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test@5.0.0/validation_summary.json")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/validation_summary.json does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ ]
+ ])
+ testSequenced (testList "package test version 5_0_0-use+suffixes" [
+ // run:
+ // - arc-validate --verbose package install test -v 2.0.0 --preview
+ // - arc-validate validate -p test -v 2.0.0 --preview -i fixtures/arcs/inveniotestarc
+ yield!
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "5.0.0-use+suffixes"; "--preview"|]
+ (get_gh_api_token())
+ ) [
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed preview package test@5.0.0-use+suffixes.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in preview cache after running package install test" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0-use+suffixes.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+ "Install: Package script does not exist in avpr cache after running package install test" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0-use+suffixes.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+
+ ]
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "validate"; "-p"; "test"; "-v"; "5.0.0-use+suffixes"; "--preview"; "-i"; "fixtures/arcs/inveniotestarc"|]
+ (get_gh_api_token())
+ ) [
+ "Validate: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Validate: Console output does not indicate that package is not installed" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Console Output is correct" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed test package v5.0.0-use+suffixes!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ ]
+ ])
testSequenced (testList "package test version latest" [
// run:
// - arc-validate --verbose package install test --preview
@@ -68,9 +191,13 @@ let ``ValidateCommand CLI Tests`` =
[|"--verbose"; "package"; "install"; "test"; "--preview"|]
(get_gh_api_token())
) [
- "Package script exists in preview cache after running package install test" ,
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed preview package test@999.999.999.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in preview cache after running package install test" ,
fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@999.999.999.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
- "Package script does not exist in avpr cache after running package install test" ,
+ "Install: Package script does not exist in avpr cache after running package install test" ,
fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@999.999.999.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
]
@@ -81,17 +208,16 @@ let ``ValidateCommand CLI Tests`` =
[|"--verbose"; "validate"; "-p"; "test"; "--preview"; "-i"; "fixtures/arcs/inveniotestarc"|]
(get_gh_api_token())
) [
- "Exit code is 0" ,
+ "Validate: Exit code is 0" ,
fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
- "Console output does not indicate that package is not installed" ,
+ "Validate: Console output does not indicate that package is not installed" ,
fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
- "Console Output is correct" ,
+ "Validate: Console Output is correct" ,
fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed preview test package v999.999.999!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
-
]
])
])
- testSequenced (testList "avpr ARCExpect < 2" [
+ testSequenced (testList "source: AVPR" [
testSequenced (testList "package test version 2" [
yield!
// run:
@@ -103,9 +229,13 @@ let ``ValidateCommand CLI Tests`` =
[|"--verbose"; "package"; "install"; "test"; "-v"; "2.0.0"|]
(get_gh_api_token())
) [
- "Package script exists in avpr cache after running package install test" ,
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed package test@2.0.0.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in avpr cache after running package install test" ,
fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@2.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
- "Package script does not exist in preview cache after running package install test" ,
+ "Install: Package script does not exist in preview cache after running package install test" ,
fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@2.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
]
@@ -116,19 +246,138 @@ let ``ValidateCommand CLI Tests`` =
[|"--verbose"; "validate"; "-p"; "test"; "-v"; "2.0.0"; "-i"; "fixtures/arcs/inveniotestarc"|]
(get_gh_api_token())
) [
- "Exit code is 0" ,
+ "Validate: Exit code is 0" ,
fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
- "Console output does not indicate that package is not installed" ,
+ "Validate: Console output does not indicate that package is not installed" ,
fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
- "Console Output is correct" ,
+ "Validate: Console Output is correct" ,
fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed test package v2.0.0!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
- "Ouptput files exist",
+ "Validate: Ouptput files exist",
fun tool args proc ->
Expect.isTrue (Directory.Exists(".arc-validate-results")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results does not exist in {System.Environment.CurrentDirectory}" proc tool args )
Expect.isTrue (File.Exists(".arc-validate-results/test/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
Expect.isTrue (File.Exists(".arc-validate-results/test/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
]
])
+ testSequenced (testList "package test version 3" [
+ yield!
+ // run:
+ // - arc-validate --verbose package install test -v 3.0.0
+ // - arc-validate validate -p test -v 3.0.0 --preview -i fixtures/arcs/inveniotestarc
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "3.0.0"|]
+ (get_gh_api_token())
+ ) [
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed package test@3.0.0.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in avpr cache after running package install test" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@3.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+ "Install: Package script does not exist in preview cache after running package install test" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@3.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+
+ ]
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "validate"; "-p"; "test"; "-v"; "3.0.0"; "-i"; "fixtures/arcs/inveniotestarc"|]
+ (get_gh_api_token())
+ ) [
+ "Validate: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Validate: Console output does not indicate that package is not installed" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Console Output is correct" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed test package v3.0.0!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Ouptput files exist",
+ fun tool args proc ->
+ Expect.isTrue (Directory.Exists(".arc-validate-results")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ ]
+ ])
+ testSequenced (testList "package test version 5" [
+ yield!
+ // run:
+ // - arc-validate --verbose package install test -v 5.0.0
+ // - arc-validate validate -p test -v 5.0.0 --preview -i fixtures/arcs/inveniotestarc
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "5.0.0"|]
+ (get_gh_api_token())
+ ) [
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed package test@5.0.0.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in avpr cache after running package install test" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+ "Install: Package script does not exist in preview cache after running package install test" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+
+ ]
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "validate"; "-p"; "test"; "-v"; "5.0.0"; "-i"; "fixtures/arcs/inveniotestarc"|]
+ (get_gh_api_token())
+ ) [
+ "Validate: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Validate: Console output does not indicate that package is not installed" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Console Output is correct" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed test package v5.0.0!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Ouptput files exist",
+ fun tool args proc ->
+ Expect.isTrue (Directory.Exists(".arc-validate-results")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test@5.0.0/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test@5.0.0/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/test@5.0.0/validation_summary.json")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/test/validation_summary.json does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ ]
+ ])
+ testSequenced (testList "package test version 5_0_0-use+suffixes" [
+ yield!
+ // run:
+ // - arc-validate --verbose package install test -v 5.0.0-use+suffixes
+ // - arc-validate validate -p test -v 5.0.0-use+suffixes --preview -i fixtures/arcs/inveniotestarc
+ testFixture (Fixtures.withToolExecution
+ true
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "package"; "install"; "test"; "-v"; "5.0.0-use+suffixes"|]
+ (get_gh_api_token())
+ ) [
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed package test@5.0.0-use+suffixes.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in avpr cache after running package install test" ,
+ fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0-use+suffixes.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+ "Install: Package script does not exist in preview cache after running package install test" ,
+ fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0-use+suffixes.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
+
+ ]
+ yield!
+ testFixture (Fixtures.withToolExecution
+ false
+ "../../../../../publish/arc-validate"
+ [|"--verbose"; "validate"; "-p"; "test"; "-v"; "5.0.0-use+suffixes"; "-i"; "fixtures/arcs/inveniotestarc"|]
+ (get_gh_api_token())
+ ) [
+ "Validate: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Validate: Console output does not indicate that package is not installed" ,
+ fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Validate: Console Output is correct" ,
+ fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed test package v5.0.0-use+suffixes!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ ]
+ ])
testSequenced (testList "package test version latest" [
// run:
// - arc-validate --verbose package install test
@@ -140,9 +389,13 @@ let ``ValidateCommand CLI Tests`` =
[|"--verbose"; "package"; "install"; "test";|]
(get_gh_api_token())
) [
- "Package script exists in avpr cache after running package install test" ,
+ "Install: Exit code is 0" ,
+ fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
+ "Install: Console output indicates that the package was installed" ,
+ fun tool args proc -> Expect.stringContains proc.Result.Output "installed package test@5.0.0.fsx at" (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
+ "Install: Package script exists in avpr cache after running package install test" ,
fun tool args proc -> Expect.isTrue (File.Exists(Path.Combine(expected_package_cache_folder_path_release, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
- "Package script does not exist in preview cache after running package install test" ,
+ "Install: Package script does not exist in preview cache after running package install test" ,
fun tool args proc -> Expect.isFalse (File.Exists(Path.Combine(expected_package_cache_folder_path_preview, "test@5.0.0.fsx"))) (ErrorMessage.withCLIDiagnostics "package file was not installed at expected location" tool args )
]
@@ -153,11 +406,11 @@ let ``ValidateCommand CLI Tests`` =
[|"--verbose"; "validate"; "-p"; "test"; "-i"; "fixtures/arcs/inveniotestarc"|]
(get_gh_api_token())
) [
- "Exit code is 0" ,
+ "Validate: Exit code is 0" ,
fun tool args proc -> Expect.equal proc.ExitCode 0 (ErrorMessage.withProcessDiagnostics "incorrect exit code" proc tool args )
- "Console output does not indicate that package is not installed" ,
+ "Validate: Console output does not indicate that package is not installed" ,
fun tool args proc -> Expect.isFalse (proc.Result.Output.Contains("Package test not installed. You can run run arc-validate package install ")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
- "Console Output is correct" ,
+ "Validate: Console Output is correct" ,
fun tool args proc -> Expect.isTrue (proc.Result.Output.Contains("If you can read this in your console, you successfully executed test package v5.0.0!")) (ErrorMessage.withProcessDiagnostics "incorrect console output" proc tool args )
]
])
@@ -184,13 +437,13 @@ let ``ValidateCommand CLI Tests`` =
"Ouptput files exist",
fun tool args proc ->
Expect.isTrue (Directory.Exists(".arc-validate-results")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results does not exist in {System.Environment.CurrentDirectory}" proc tool args )
- Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
- Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
- Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0/validation_summary.json")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0/validation_summary.json does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0-draft/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0-draft/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0-draft/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0-draft/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0-draft/validation_summary.json")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0-draft/validation_summary.json does not exist in {System.Environment.CurrentDirectory}" proc tool args )
"Test arc passes spec validation",
fun tool args proc ->
let summary =
- ".arc-validate-results/arc_specification@2.0.0/validation_summary.json"
+ ".arc-validate-results/arc_specification@2.0.0-draft/validation_summary.json"
|> File.ReadAllText
|> fun x -> x.ReplaceLineEndings("\n")
|> ValidationSummary.fromJson
@@ -223,13 +476,13 @@ let ``ValidateCommand CLI Tests`` =
"Ouptput files exist",
fun tool args proc ->
Expect.isTrue (Directory.Exists(".arc-validate-results")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results does not exist in {System.Environment.CurrentDirectory}" proc tool args )
- Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
- Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
- Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0/validation_summary.json")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0/validation_summary.json does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0-draft/badge.svg")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0-draft/badge.svg does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0-draft/validation_report.xml")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0-draft/validation_report.xml does not exist in {System.Environment.CurrentDirectory}" proc tool args )
+ Expect.isTrue (File.Exists(".arc-validate-results/arc_specification@2.0.0-draft/validation_summary.json")) (ErrorMessage.withProcessDiagnostics $".arc-validate-results/arc_specification@2.0.0-draft/validation_summary.json does not exist in {System.Environment.CurrentDirectory}" proc tool args )
"Test arc passes spec validation",
fun tool args proc ->
let summary =
- ".arc-validate-results/arc_specification@2.0.0/validation_summary.json"
+ ".arc-validate-results/arc_specification@2.0.0-draft/validation_summary.json"
|> File.ReadAllText
|> fun x -> x.ReplaceLineEndings("\n")
|> ValidationSummary.fromJson
diff --git a/tests/arc-validate.Tests/ReferenceObjects.fs b/tests/arc-validate.Tests/ReferenceObjects.fs
index c17c18a..fbc250c 100644
--- a/tests/arc-validate.Tests/ReferenceObjects.fs
+++ b/tests/arc-validate.Tests/ReferenceObjects.fs
@@ -7,7 +7,7 @@ open type System.Environment
let ``invenio test arc validation results`` = ValidationResults.fromJUnitFile "fixtures/xml/inveniotestarc/arc-validate-results.xml"
-let test_package_script_content_v1 = """(*
+let test_package_script_content_v1_0_0 = """(*
---
Name: test
Summary: this package is here for testing purposes only.
@@ -35,9 +35,9 @@ validationCases
|> Execute.ValidationPipeline(
basePath = System.Environment.CurrentDirectory,
packageName = "test"
-)""" .ReplaceLineEndings()
+)""" .ReplaceLineEndings("\n")
-let test_package_script_content_v2 = """(*
+let test_package_script_content_v2_0_0 = """(*
---
Name: test
MajorVersion: 2
@@ -79,9 +79,9 @@ validationCases
|> Execute.ValidationPipeline(
basePath = System.Environment.CurrentDirectory,
packageName = "test"
-)""" .ReplaceLineEndings()
+)""" .ReplaceLineEndings("\n")
-let test_package_script_content_v3 = """(*
+let test_package_script_content_v3_0_0 = """(*
---
Name: test
MajorVersion: 3
@@ -123,4 +123,81 @@ validationCases
|> Execute.ValidationPipeline(
basePath = System.Environment.CurrentDirectory,
packageName = "test"
-)""" .ReplaceLineEndings()
\ No newline at end of file
+)""" .ReplaceLineEndings("\n")
+
+let test_package_script_content_v5_0_0 = "let []PACKAGE_METADATA = \"\"\"(*
+---
+Name: test
+MajorVersion: 5
+MinorVersion: 0
+PatchVersion: 0
+Publish: true
+Summary: this package is here for testing purposes only.
+Description: this package is here for testing purposes only.
+Authors:
+ - FullName: John Doe
+ Email: j@d.com
+ Affiliation: University of Nowhere
+ AffiliationLink: https://nowhere.edu
+ - FullName: Jane Doe
+ Email: jj@d.com
+ Affiliation: University of Somewhere
+ AffiliationLink: https://somewhere.edu
+Tags:
+ - Name: validation
+ - Name: my-package
+ - Name: thing
+ReleaseNotes: Use ARCExpect v3
+CQCHookEndpoint: https://avpr.nfdi4plants.org
+---
+*)\"\"\"
+
+printfn \"If you can read this in your console, you successfully executed test package v5.0.0!\"
+
+#r \"nuget: ARCExpect, 3.0.0\"
+
+open ARCExpect
+open Expecto
+let test_package =
+ Setup.ValidationPackage(
+ metadata = Setup.Metadata(PACKAGE_METADATA),
+ CriticalValidationCases = [
+ test \"yes\" {Expect.equal 1 1 \"yes\"}
+ ]
+ )
+
+test_package
+|> Execute.ValidationPipeline(
+ basePath = System.Environment.CurrentDirectory
+)" .ReplaceLineEndings("\n")
+
+let ``test_package_script_content_v5_0_0-use+suffixes`` = "(*
+---
+Name: test
+MajorVersion: 5
+MinorVersion: 0
+PatchVersion: 0
+PreReleaseVersionSuffix: use
+BuildMetadataVersionSuffix: suffixes
+Publish: true
+Summary: this package is here for testing purposes only.
+Description: this package is here for testing purposes only.
+Authors:
+ - FullName: John Doe
+ Email: j@d.com
+ Affiliation: University of Nowhere
+ AffiliationLink: https://nowhere.edu
+ - FullName: Jane Doe
+ Email: jj@d.com
+ Affiliation: University of Somewhere
+ AffiliationLink: https://somewhere.edu
+Tags:
+ - Name: validation
+ - Name: my-package
+ - Name: thing
+ReleaseNotes: Use pre-release and build metadata version suffixes
+CQCHookEndpoint: https://avpr.nfdi4plants.org
+---
+*)
+
+printfn \"If you can read this in your console, you successfully executed test package v5.0.0-use+suffixes!\" ".ReplaceLineEndings("\n")