Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reworked #202] Add simple git functions to test contract behaviour #203

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8b5093d
fix #182
kMutagene Sep 12, 2023
d6c525e
Merge pull request #186 from nfdi4plants/fix-#182
HLWeil Sep 12, 2023
35c3577
implement #188
kMutagene Sep 12, 2023
095114d
implement #187
kMutagene Sep 12, 2023
907f3a2
fix GetRegisteredPayload cell conversion failure
kMutagene Sep 12, 2023
affab06
Use path literals for payload path filtering
kMutagene Sep 13, 2023
4e676ea
Merge pull request #189 from nfdi4plants/implement-#187
HLWeil Sep 14, 2023
03e9784
Update ArcTypes to ref parent :construction:
Freymaurer Sep 6, 2023
2912c02
Work on update :construction:
Freymaurer Sep 6, 2023
658f914
isa and isa.json tests pass :heavy_check_mark:
Freymaurer Sep 7, 2023
bb2a84c
Add ArcStudy assay handling tests :white_check_mark:
Freymaurer Sep 7, 2023
923eb2d
Add more tests :white_check_mark:
Freymaurer Sep 8, 2023
a155528
add registered studies to investigation
HLWeil Sep 8, 2023
de7f51f
Rename study.assay api and fix tests
Freymaurer Sep 8, 2023
535eaff
fix and improve ISA Spreadsheet tests for assay/study registration
HLWeil Sep 8, 2023
72e1b02
start adding update functions
HLWeil Sep 11, 2023
145dbb7
Work on UpdateBy on assay,study,investigation :construction:
Freymaurer Sep 11, 2023
ed7be2e
finish up first version of updated arc read in
HLWeil Sep 12, 2023
47489d1
add helper functions
HLWeil Sep 14, 2023
bf7b5ca
add table updating tests and fix underlying functions
HLWeil Sep 15, 2023
317be82
fix spreadsheet reader parsing empty ontology annotations
HLWeil Sep 17, 2023
ef0ec6b
test and fix arc read in with updating of objects against each other
HLWeil Sep 17, 2023
03f1dd2
some comments and small adjustments
HLWeil Sep 18, 2023
f812f4c
fix merge inconsistencies
HLWeil Sep 18, 2023
b18400f
Merge pull request #184 from nfdi4plants/developer_TopLevelAssays
HLWeil Sep 18, 2023
f3cb081
Add ARCtrl tests to runTests target :bug:
Freymaurer Sep 18, 2023
ec3f7d0
Add SemVer logic :white_check_mark:
Freymaurer Sep 18, 2023
8c9e1db
Add templates+json+tests :sparkles::white_check_mark:
Freymaurer Sep 18, 2023
e5353b0
Apply changes according to PR-review #191
Freymaurer Sep 18, 2023
a806c7d
Change json-format to write ProcessSequence instead of ArcTable
Freymaurer Sep 18, 2023
62b27d9
Add js arctrl tests to CI
Freymaurer Sep 19, 2023
a67d9e2
Make tests pass
Freymaurer Sep 19, 2023
9764151
fix protocol REF appearing after ArcTable to process roundabout conve…
HLWeil Sep 19, 2023
b65d2dc
Add template equality + tests
Freymaurer Sep 19, 2023
22f1b92
Improve robustness of runTests logic :sparkles:
Freymaurer Sep 19, 2023
6c5bff8
Update StructuralEquals naming
Freymaurer Sep 19, 2023
b46e9a4
Merge pull request #191 from nfdi4plants/developer_TemplatesJson
Freymaurer Sep 19, 2023
2a81a65
fix and test metadatasheet reader interpreting empty strings
HLWeil Sep 20, 2023
ae9ff1c
fix and test table updating failing for specific tables
HLWeil Sep 20, 2023
104282e
Merge pull request #192 from nfdi4plants/fixes
Freymaurer Sep 20, 2023
91b3f01
restructure testing environment
HLWeil Sep 20, 2023
70f288b
unified mocha and expecto functionality into TestingUtils project
HLWeil Sep 20, 2023
2ede92d
Merge pull request #194 from nfdi4plants/developer_testRestructure
Freymaurer Sep 20, 2023
110b19d
bump to 1.0.0-alpha5
HLWeil Sep 20, 2023
e32c196
add test and fix for empty ArcTable process conversion
HLWeil Sep 20, 2023
25e71b7
Merge pull request #199 from nfdi4plants/developer_templates
Freymaurer Sep 20, 2023
1c395d0
Improve UpdateHeader forceConvert flag :bug:#198
Freymaurer Sep 20, 2023
f37c0a4
cleanup unnecessary testfiles
HLWeil Sep 20, 2023
0c9980f
add template xlsx parsing
HLWeil Sep 20, 2023
d24e96a
Work on #197 :construction:
Freymaurer Sep 21, 2023
e8854d4
Add GetContent() for CompositeCell #190
Freymaurer Sep 21, 2023
24b415a
Add tests for CompositeCell.GetContent :white_check_mark:
Freymaurer Sep 21, 2023
476dc6d
Add CompositeHeader js helpers #197
Freymaurer Sep 21, 2023
a14f180
Add native js test :white_check_mark:
Freymaurer Sep 21, 2023
2f4709e
Merge pull request #200 from nfdi4plants/developer_Issues
Freymaurer Sep 21, 2023
0b20e1c
test and fix template spreadsheet parsing
HLWeil Sep 21, 2023
2419fa5
add and fix full template xlsx file parsing
HLWeil Sep 21, 2023
437c17f
Merge pull request #201 from nfdi4plants/developer_templates
HLWeil Sep 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ARCtrl.sln
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "playground", "playground",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JavaScript", "JavaScript", "{913222CA-261F-49CB-A823-CC7C335F964A}"
ProjectSection(SolutionItems) = preProject
tests\JavaScript\ISA.CompositeHeader.js = tests\JavaScript\ISA.CompositeHeader.js
tests\JavaScript\ISA.Person.js = tests\JavaScript\ISA.Person.js
tests\JavaScript\Main.js = tests\JavaScript\Main.js
EndProjectSection
Expand All @@ -67,6 +68,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.Contract", "src\Cont
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FileSystem.Tests", "tests\FileSystem\FileSystem.Tests.fsproj", "{D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TestingUtils", "tests\TestingUtils\TestingUtils.fsproj", "{AA011593-6603-4E16-A7B0-0ED3862511DE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -125,6 +128,10 @@ Global
{D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3}.Release|Any CPU.Build.0 = Release|Any CPU
{AA011593-6603-4E16-A7B0-0ED3862511DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA011593-6603-4E16-A7B0-0ED3862511DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA011593-6603-4E16-A7B0-0ED3862511DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA011593-6603-4E16-A7B0-0ED3862511DE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -145,6 +152,7 @@ Global
{801247D5-7EE5-49C8-AB26-F822A415BA49} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{1945EE8A-F105-43A9-91C9-8C4422B9873E} = {6DA2330B-D407-4FB1-AF05-B0184034EC44}
{D9FE196B-AC21-4C3E-B9AE-DDDEC2158BC3} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{AA011593-6603-4E16-A7B0-0ED3862511DE} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1E354DE6-99BA-421E-9EF8-E808B855A85F}
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### 1.0.0+ece863d (Released 2023-9-4)
### 1.0.0+70f288b (Released 2023-9-20)
* Additions:
* Complete overhaul of the API.
* Shifted focus from only ISA to include full ARC.
Expand Down
8 changes: 8 additions & 0 deletions build/ProjectInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ open Fake.Core

let project = "ARCtrl"

/// Dotnet and JS test paths
let testProjects =
[
"tests/ISA/ISA.Tests"
"tests/ISA/ISA.Json.Tests"
"tests/ISA/ISA.Spreadsheet.Tests"
"tests/FileSystem"
"tests/ARCtrl"
]

/// Native JS test paths
let jsTestProjects =
[
"tests/JavaScript"
]

let solutionFile = $"{project}.sln"
Expand Down
112 changes: 24 additions & 88 deletions build/TestTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ open Fake.DotNet

open ProjectInfo
open BasicTasks
open Fake.Core

[<AutoOpen>]
module private Helper =
Expand Down Expand Up @@ -93,6 +94,17 @@ module private Helper =

createProcess npmPath

let npx =
let npmPath =
match ProcessUtils.tryFindFileOnPath "npx" with
| Some path -> path
| None ->
"npm was not found in path. Please install it and make sure it's available from your path. " +
"See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info"
|> failwith

createProcess npmPath

let run proc arg dir =
proc arg dir
|> Proc.run
Expand All @@ -105,16 +117,18 @@ module private Helper =

module RunTests =

/// runs `npm test` in root.
/// npm test consists of `test` and `pretest`
/// check package.json in root for behavior
let runTestsJs = BuildTask.create "runTestsJS" [clean; build] {
//run npm "test --prefix ./src/ISA" ""
run npm "test" ""
run npm "run testJson" ""
run npm "run testSpreadsheet" ""
run npm "run testFS" ""
run npm "run testjs" ""
for path in ProjectInfo.testProjects do
// transpile js files from fsharp code
run dotnet $"fable {path} -o {path}/js" ""
// run mocha in target path to execute tests
// "--timeout 20000" is used, because json schema validation takes a bit of time.
run npx $"mocha {path}/js --timeout 20000" ""
Trace.traceImportant "Start native JavaScript tests"
for path in ProjectInfo.jsTestProjects do
// transpile library for native access
run dotnet $"fable src/ARCtrl -o {path}/ARCtrl" ""
run npx $"mocha {path} --timeout 20000" ""
}

let runTestsDotnet = BuildTask.create "runTestsDotnet" [clean; build] {
Expand All @@ -133,82 +147,4 @@ module RunTests =

let runTests = BuildTask.create "RunTests" [clean; build; RunTests.runTestsJs; RunTests.runTestsDotnet] {
()
}

// // ! Decided to remove watch test logic for now, as formatting is really bad anyways and we support test explorer ! //
//module WatchTests =

//let [<Literal>] JS_FolderName = "js"

//[<Literal>]
//let FableTestPath_input = "tests/ISA/ISA.Tests"
//let FableTestPath_output = System.IO.Path.Combine(FableTestPath_input, JS_FolderName)

//[<Literal>]
//let JsonFableTestPath_input = "tests/ISA/ISA.Json.Tests"
//let JsonFableTestPath_output = System.IO.Path.Combine(JsonFableTestPath_input, JS_FolderName)

//[<Literal>]
//let SpreadsheetFableTestPath_input = "tests/ISA/ISA.Spreadsheet.Tests"
//let SpreadsheetFableTestPath_output = System.IO.Path.Combine(SpreadsheetFableTestPath_input, JS_FolderName)

// let private watchProjTests (projPath:string) =
// let pName =
// let n = System.IO.Path.GetFileNameWithoutExtension(projPath)
// $"[{n}]"
// pName, dotnet "watch run" projPath

// let private dotnetTestsProcesses =
// [
// for testProj in testProjects do
// yield watchProjTests testProj
// ]

// let private fableTestsProcesses =
// [
// "[ISADotNet Fable]", dotnet $"fable watch {FableTestPath_input} -o {FableTestPath_output} --run npm run test:live" "."
// "[ISADotNet Mocha]", npm $"run testnative:live" "."
// "[ISADotNet.Json Fable]", dotnet $"fable watch {JsonFableTestPath_input} -o {JsonFableTestPath_output} --run npm run testJson:live" "."
// "[ISADotNet.Json Mocha]", npm $"run testJsonnative:live" "."
// ]

// let allTest = dotnetTestsProcesses@fableTestsProcesses

// let watchTestsDotnet = BuildTask.create "watchTestsDotnet" [clean; build] {
// dotnetTestsProcesses
// |> runParallel
// }

// let watchJS = BuildTask.create "watchTestsJS" [clean; build] {
// fableTestsProcesses
// |> runParallel
// }

//let watchTests = BuildTask.create "watchTests" [clean; build] {
// WatchTests.allTest
// |> runParallel
//}

//// to do: use this once we have actual tests ~ Kevin Schneider
//// Not sure how this interacts with the changes for fable compatibility, i will..
//// ..leave it in for now ~ Kevin Frey
//let runTestsWithCodeCov = BuildTask.create "RunTestsWithCodeCov" [clean; build] {
// let standardParams = Fake.DotNet.MSBuild.CliArguments.Create ()
// testProjects
// |> Seq.iter(fun testProject ->
// Fake.DotNet.DotNet.test(fun testParams ->
// {
// testParams with
// MSBuildParams = {
// standardParams with
// Properties = [
// "AltCover","true"
// "AltCoverCobertura","../../codeCov.xml"
// "AltCoverForce","true"
// ]
// };
// Logger = Some "console;verbosity=detailed"
// }
// ) testProject
// )
//}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
"description": "Top level ARC DataModel and API function descriptions.",
"type": "module",
"scripts": {
"mocha": "mocha",
"prebundlejs": "mkdirp .\\dist/js && dotnet fable clean -o ./dist/js --yes",
"bundlejs": "dotnet fable ./src/ARCtrl -o ./dist/js",
"prebundlets": "mkdirp .\\dist/ts && dotnet fable clean -o ./dist/ts --yes --extension .ts",
"bundlets": "dotnet fable ./src/ARCtrl -o ./dist/ts --lang ts",
"pretestJson": "dotnet fable tests/ISA/ISA.Json.Tests -o tests/ISA/ISA.Json.Tests/js",
"testJson": "mocha tests/ISA/ISA.Json.Tests/js --timeout 20000",
"pretestSpreadsheet": "dotnet fable tests/ISA/ISA.Spreadsheet.Tests -o tests/ISA/ISA.Spreadsheet.Tests/js",
"testSpreadsheet": "mocha tests/ISA/ISA.Spreadsheet.Tests/js",
"pretest": "dotnet fable tests/ISA/ISA.Tests -o tests/ISA/ISA.Tests/js",
"test": "mocha tests/ISA/ISA.Tests/js",
"pretestFS": "dotnet fable tests/FileSystem -o tests/FileSystem/js",
"testFS": "mocha tests/FileSystem/js",
"pretestARC": "dotnet fable tests/ARCtrl -o tests/ARCtrl/js",
"testARC": "mocha tests/ARCtrl/js",
"pretestjs": "dotnet fable src/ARCtrl -o tests/JavaScript/ARCtrl",
"pretestXlsx": "dotnet fable tests/ISA/ISA.Spreadsheet.Tests -o tests/ISA/ISA.Spreadsheet.Tests/js",
"testXlsx": "mocha tests/ISA/ISA.Spreadsheet.Tests/js",
"pretestIsa": "dotnet fable tests/ISA/ISA.Tests -o tests/ISA/ISA.Tests/js",
"testIsa": "mocha tests/ISA/ISA.Tests/js",
"pretestFiles": "dotnet fable tests/FileSystem -o tests/FileSystem/js",
"testFiles": "mocha tests/FileSystem/js",
"pretestArctrl": "dotnet fable tests/ARCtrl -o tests/ARCtrl/js",
"testArctrl": "mocha tests/ARCtrl/js",
"pretestjs": "dotnet fable src/ARCtrl -o tests/JavaScript/ARCtrl ",
"testjs": "mocha tests/JavaScript",
"pretestpy": "dotnet fable src/ARCtrl -o tests/Python/ARCtrl --lang py ",
"testpy": "",
Expand Down
Loading