-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update upstream dependencies, add tests for a package with CQCHookEnd…
…point
- Loading branch information
Showing
12 changed files
with
158 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ let ``GitHubAPI tests`` = | |
response | ||
|> fun json -> (json?content).GetString() | ||
|> fun content -> Convert.FromBase64String(content) | ||
|> fun bytes -> Encoding.UTF8.GetString(bytes).ReplaceLineEndings() | ||
|> fun bytes -> Encoding.UTF8.GetString(bytes).ReplaceLineEndings("\n") | ||
) | ||
ReferenceObjects.testScriptContent | ||
$"repository content was not correct{System.Environment.NewLine}{response}" | ||
|
@@ -48,7 +48,7 @@ let ``GitHubAPI tests`` = | |
} | ||
test "getPackageIndex contains test script" { | ||
let indexedPackages = GitHubAPI.getPackageIndex(?Token = token) | ||
Expect.isTrue (indexedPackages |> Array.exists (fun package -> package.RepoPath = "StagingArea/test/[email protected]")) "package index did not contain test script" | ||
Expect.isTrue (indexedPackages |> Array.exists (fun package -> package.RepoPath = "./StagingArea/test/[email protected]")) "package index did not contain test script" | ||
} | ||
test "getScriptContent terminates" { | ||
GitHubAPI.downloadPackageScript( | ||
|
@@ -64,7 +64,7 @@ let ``GitHubAPI tests`` = | |
"StagingArea/test/[email protected]", | ||
?Token = token | ||
) | ||
|> fun content -> content.ReplaceLineEndings() | ||
|> fun content -> content.ReplaceLineEndings("\n") | ||
) | ||
ReferenceObjects.testScriptContent | ||
"script content was not correct" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,9 +52,9 @@ validationCases | |
|> Execute.ValidationPipeline( | ||
basePath = System.Environment.CurrentDirectory, | ||
packageName = "test" | ||
)""" .ReplaceLineEndings() | ||
)""" .ReplaceLineEndings("\n") | ||
|
||
let testScriptContentAVPR = """(* | ||
let testScriptContentAVPR_test_3_0_0 = """(* | ||
--- | ||
Name: test | ||
MajorVersion: 3 | ||
|
@@ -96,7 +96,53 @@ validationCases | |
|> Execute.ValidationPipeline( | ||
basePath = System.Environment.CurrentDirectory, | ||
packageName = "test" | ||
)""" .ReplaceLineEndings() | ||
)""" .ReplaceLineEndings("\n") | ||
|
||
let testScriptContentAVPR_test_5_0_0 = "let [<Literal>]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: [email protected] | ||
Affiliation: University of Nowhere | ||
AffiliationLink: https://nowhere.edu | ||
- FullName: Jane Doe | ||
Email: [email protected] | ||
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 testValidationPackage1 = | ||
CachedValidationPackage.create( | ||
|
@@ -157,4 +203,37 @@ let testScriptPath = "fixtures/testScript.fsx" | |
let testScriptArgsPath = "fixtures/testScriptArgs.fsx" | ||
|
||
let testScriptPackage = CachedValidationPackage.create("testScript", testDate1, testScriptPath, ValidationPackageMetadata()) | ||
let testScriptArgsPackage = CachedValidationPackage.create("testScriptArgs", testDate1, testScriptArgsPath, ValidationPackageMetadata()) | ||
let testScriptArgsPackage = CachedValidationPackage.create("testScriptArgs", testDate1, testScriptArgsPath, ValidationPackageMetadata()) | ||
|
||
module AVPRClientDomain = | ||
module ValidationPackage = | ||
let testPackage_3_0_0 = AVPRClient.ValidationPackage( | ||
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 = [| | ||
AVPRClient.Author( | ||
FullName = "John Doe", | ||
Email = "[email protected]", | ||
Affiliation = "University of Nowhere", | ||
AffiliationLink = "https://nowhere.edu" | ||
) | ||
AVPRClient.Author( | ||
FullName = "Jane Doe", | ||
Email = "[email protected]", | ||
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 = "add authors and tags for further testing", | ||
PackageContent = System.Text.Encoding.UTF8.GetBytes testScriptContentAVPR_test_3_0_0, | ||
CQCHookEndpoint = "" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters