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

Nuget package fix and test time adjustment #452

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions ARCtrl.sln
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.ROCrate", "src\ROCra
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.ROCrate.Tests", "tests\ROCrate\ARCtrl.ROCrate.Tests.fsproj", "{212A1C64-02FC-465A-B0FA-F69735F37ACC}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "All.Tests", "tests\All\All.Tests.fsproj", "{243ACD5F-10AD-4BE6-9932-829667BE2053}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -187,6 +189,10 @@ Global
{212A1C64-02FC-465A-B0FA-F69735F37ACC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{212A1C64-02FC-465A-B0FA-F69735F37ACC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{212A1C64-02FC-465A-B0FA-F69735F37ACC}.Release|Any CPU.Build.0 = Release|Any CPU
{243ACD5F-10AD-4BE6-9932-829667BE2053}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{243ACD5F-10AD-4BE6-9932-829667BE2053}.Debug|Any CPU.Build.0 = Debug|Any CPU
{243ACD5F-10AD-4BE6-9932-829667BE2053}.Release|Any CPU.ActiveCfg = Release|Any CPU
{243ACD5F-10AD-4BE6-9932-829667BE2053}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -215,6 +221,7 @@ Global
{D10D12C7-B877-423B-867D-161D99E673C9} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{658BF141-B4B5-4B90-891D-AC36A3FD7574} = {6DA2330B-D407-4FB1-AF05-B0184034EC44}
{212A1C64-02FC-465A-B0FA-F69735F37ACC} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
{243ACD5F-10AD-4BE6-9932-829667BE2053} = {64B34A6E-318D-4E6E-9262-CE52C9B85A38}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1E354DE6-99BA-421E-9EF8-E808B855A85F}
Expand Down
19 changes: 10 additions & 9 deletions build/ProjectInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ let project = "ARCtrl"
/// Dotnet and JS test paths
let testProjects =
[
"tests/Core"
"tests/Json"
"tests/Spreadsheet"
"tests/FileSystem"
"tests/ARCtrl"
"tests/Yaml"
"tests/ValidationPackages"
"tests/Contract"
"tests/ROCrate"
"tests/All"
//"tests/Core"
//"tests/Json"
//"tests/Spreadsheet"
//"tests/FileSystem"
//"tests/ARCtrl"
//"tests/Yaml"
//"tests/ValidationPackages"
//"tests/Contract"
//"tests/ROCrate"
]

/// Native JS test paths
Expand Down
93 changes: 57 additions & 36 deletions build/TestTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ open Fake.Core

module RunTests =

let skipTestsFlag = "--skipTests"

let runTestsUI = BuildTask.create "runTestsUI" [clean; build] {
let path = "tests/UI"
Trace.traceImportant "Start UI tests"
Expand All @@ -18,46 +20,65 @@ module RunTests =
run npx $"cypress run --component -P {path}" ""
}

let runTestsJsNative = BuildTask.create "runTestsJSNative" [clean; build] {
Trace.traceImportant "Start native JavaScript tests"
for path in ProjectInfo.jsTestProjects do
// transpile library for native access
run dotnet $"fable src/ARCtrl/ARCtrl.Javascript.fsproj -o {path}/ARCtrl" ""
GenerateIndexJs.ARCtrl_generate($"{path}/ARCtrl")
run npx $"mocha {path} --timeout 20000" ""
}
let runTestsJsNative = BuildTask.createFn "runTestsJSNative" [clean; build] (fun tp ->
if tp.Context.Arguments |> List.exists (fun a -> a.ToLower() = skipTestsFlag.ToLower()) |> not then
Trace.traceImportant "Start native JavaScript tests"
for path in ProjectInfo.jsTestProjects do
// transpile library for native access
run dotnet $"fable src/ARCtrl/ARCtrl.Javascript.fsproj -o {path}/ARCtrl --nocache" ""
GenerateIndexJs.ARCtrl_generate($"{path}/ARCtrl")
run npx $"mocha {path} --timeout 20000" ""
else
Trace.traceImportant "Skipping JavaScript tests"
)

let runTestsJs = BuildTask.create "runTestsJS" [clean; build] {
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 node $"{path}/js/Main.js" ""
}
let runTestsJs = BuildTask.createFn "runTestsJS" [clean; build] (fun tp ->
if tp.Context.Arguments |> List.exists (fun a -> a.ToLower() = skipTestsFlag.ToLower()) |> not then
Trace.traceImportant "Start Js tests"
for path in ProjectInfo.testProjects do
// transpile js files from fsharp code
run dotnet $"fable {path} -o {path}/js --nocache" ""
// run mocha in target path to execute tests
// "--timeout 20000" is used, because json schema validation takes a bit of time.
run node $"{path}/js/Main.js" ""
else
Trace.traceImportant "Skipping Js tests"
)

let runTestsPyNative = BuildTask.create "runTestsPyNative" [clean; build] {
Trace.traceImportant "Start native Python tests"
for path in ProjectInfo.pyTestProjects do
// transpile library for native access
run dotnet $"fable src/ARCtrl/ARCtrl.Python.fsproj -o {path}/ARCtrl --lang python" ""
GenerateIndexPy.ARCtrl_generate($"{path}/ARCtrl")
run python $"-m pytest {path}" ""
}
let runTestsPyNative = BuildTask.createFn "runTestsPyNative" [clean; build] (fun tp ->
if tp.Context.Arguments |> List.exists (fun a -> a.ToLower() = skipTestsFlag.ToLower()) |> not then
Trace.traceImportant "Start native Python tests"
for path in ProjectInfo.pyTestProjects do
// transpile library for native access
run dotnet $"fable src/ARCtrl/ARCtrl.Python.fsproj -o {path}/ARCtrl --lang python --nocache" ""
GenerateIndexPy.ARCtrl_generate($"{path}/ARCtrl")
run python $"-m pytest {path}" ""
else
Trace.traceImportant "Skipping Python tests"
)

let runTestsPy = BuildTask.create "runTestsPy" [clean; build] {
for path in ProjectInfo.testProjects do
//transpile py files from fsharp code
run dotnet $"fable {path} -o {path}/py --lang python" ""
// run pyxpecto in target path to execute tests in python
run python $"{path}/py/main.py" ""
}
let runTestsPy = BuildTask.createFn "runTestsPy" [clean; build] (fun tp ->
if tp.Context.Arguments |> List.exists (fun a -> a.ToLower() = skipTestsFlag.ToLower()) |> not then
Trace.traceImportant "Start Python tests"
for path in ProjectInfo.testProjects do
//transpile py files from fsharp code
run dotnet $"fable {path} -o {path}/py --lang python --nocache" ""
// run pyxpecto in target path to execute tests in python
run python $"{path}/py/main.py" ""
else
Trace.traceImportant "Skipping Python tests"

let runTestsDotnet = BuildTask.create "runTestsDotnet" [clean; build] {
let dotnetRun = run dotnet "run"
testProjects
|> Seq.iter dotnetRun
}
)

let runTestsDotnet = BuildTask.createFn "runTestsDotnet" [clean; build] (fun tp ->
if tp.Context.Arguments |> List.exists (fun a -> a.ToLower() = skipTestsFlag.ToLower()) |> not then
Trace.traceImportant "Start .NET tests"
let dotnetRun = run dotnet "run"
testProjects
|> Seq.iter dotnetRun
else
Trace.traceImportant "Skipping .NET tests"
)

let runTestProject = BuildTask.createFn "runTestProject" [clean; build] (fun config ->
let dotnetRun = run dotnet "run"
Expand Down
4 changes: 2 additions & 2 deletions src/ARCtrl/ARCtrl.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Library for management of Annotated Research Contexts (ARCs) using an in-memory representation and runtime agnostic contract systems.</Description>
</PropertyGroup>
<ItemGroup>
<!--<ItemGroup>
<Compile Include="JsonIO\Decode.fs" />
<Compile Include="JsonIO\Encode.fs" />
<Compile Include="JsonIO\Comment.fs" />
Expand Down Expand Up @@ -43,7 +43,7 @@
<Compile Include="JsonIO\ROCrateObject.fs" />
<Compile Include="JsonIO\ARC.fs" />
<None Include="README.md" />
</ItemGroup>
</ItemGroup>-->
<ItemGroup>
<ProjectReference Include="..\Contract\ARCtrl.Contract.fsproj" />
<ProjectReference Include="..\CWL\ARCtrl.CWL.fsproj" />
Expand Down
45 changes: 45 additions & 0 deletions src/ARCtrl/ARCtrl.Javascript.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,52 @@
<Import Project="../Package.Metadata.props" />

<Import Project="ARCtrl.Common.props" />

<ItemGroup>
<Compile Include="JsonIO\Decode.fs" />
<Compile Include="JsonIO\Encode.fs" />
<Compile Include="JsonIO\Comment.fs" />
<Compile Include="JsonIO\OntologyAnnotation.fs" />
<Compile Include="JsonIO\OntologySourceReference.fs" />
<Compile Include="JsonIO\DataFile.fs" />
<Compile Include="JsonIO\Data.fs" />
<Compile Include="JsonIO\Person.fs" />
<Compile Include="JsonIO\Publication.fs" />
<Compile Include="JsonIO\Process\Value.fs" />
<Compile Include="JsonIO\Process\Factor.fs" />
<Compile Include="JsonIO\Process\FactorValue.fs" />
<Compile Include="JsonIO\Process\ProtocolParameter.fs" />
<Compile Include="JsonIO\Process\MaterialType.fs" />
<Compile Include="JsonIO\Process\MaterialAttribute.fs" />
<Compile Include="JsonIO\Process\Component.fs" />
<Compile Include="JsonIO\Process\Protocol.fs" />
<Compile Include="JsonIO\Process\MaterialAttributeValue.fs" />
<Compile Include="JsonIO\Process\Material.fs" />
<Compile Include="JsonIO\Process\Source.fs" />
<Compile Include="JsonIO\Process\Sample.fs" />
<Compile Include="JsonIO\Process\ProcessParameterValue.fs" />
<Compile Include="JsonIO\Process\ProcessInput.fs" />
<Compile Include="JsonIO\Process\ProcessOutput.fs" />
<Compile Include="JsonIO\Process\Process.fs" />
<Compile Include="JsonIO\Process\ProcessSequence.fs" />
<Compile Include="JsonIO\Process\StudyMaterials.fs" />
<Compile Include="JsonIO\Table\Compression.fs" />
<Compile Include="JsonIO\Table\CompositeCell.fs" />
<Compile Include="JsonIO\Table\IOType.fs" />
<Compile Include="JsonIO\Table\CompositeHeader.fs" />
<Compile Include="JsonIO\Table\ArcTable.fs" />
<Compile Include="JsonIO\Table\Templates.fs" />
<Compile Include="JsonIO\DataMap\DataMap.fs" />
<Compile Include="JsonIO\Assay.fs" />
<Compile Include="JsonIO\Study.fs" />
<Compile Include="JsonIO\Investigation.fs" />
<Compile Include="JsonIO\ROCrateObject.fs" />
<Compile Include="JsonIO\ARC.fs" />
<None Include="README.md" />
</ItemGroup>

<ItemGroup>
<Content Include="ARCtrl.Common.props" Pack="true" PackagePath="fable/"/>
<Compile Include="WebRequest\WebRequest.Node.fs" />
<Compile Include="WebRequest\WebRequest.fs" />
<Compile Include="Template.Web.fs" />
Expand Down
47 changes: 46 additions & 1 deletion src/ARCtrl/ARCtrl.Python.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,52 @@
<Import Project="../Package.Metadata.props" />

<Import Project="ARCtrl.Common.props" />
<ItemGroup>

<ItemGroup>
<Compile Include="JsonIO\Decode.fs" />
<Compile Include="JsonIO\Encode.fs" />
<Compile Include="JsonIO\Comment.fs" />
<Compile Include="JsonIO\OntologyAnnotation.fs" />
<Compile Include="JsonIO\OntologySourceReference.fs" />
<Compile Include="JsonIO\DataFile.fs" />
<Compile Include="JsonIO\Data.fs" />
<Compile Include="JsonIO\Person.fs" />
<Compile Include="JsonIO\Publication.fs" />
<Compile Include="JsonIO\Process\Value.fs" />
<Compile Include="JsonIO\Process\Factor.fs" />
<Compile Include="JsonIO\Process\FactorValue.fs" />
<Compile Include="JsonIO\Process\ProtocolParameter.fs" />
<Compile Include="JsonIO\Process\MaterialType.fs" />
<Compile Include="JsonIO\Process\MaterialAttribute.fs" />
<Compile Include="JsonIO\Process\Component.fs" />
<Compile Include="JsonIO\Process\Protocol.fs" />
<Compile Include="JsonIO\Process\MaterialAttributeValue.fs" />
<Compile Include="JsonIO\Process\Material.fs" />
<Compile Include="JsonIO\Process\Source.fs" />
<Compile Include="JsonIO\Process\Sample.fs" />
<Compile Include="JsonIO\Process\ProcessParameterValue.fs" />
<Compile Include="JsonIO\Process\ProcessInput.fs" />
<Compile Include="JsonIO\Process\ProcessOutput.fs" />
<Compile Include="JsonIO\Process\Process.fs" />
<Compile Include="JsonIO\Process\ProcessSequence.fs" />
<Compile Include="JsonIO\Process\StudyMaterials.fs" />
<Compile Include="JsonIO\Table\Compression.fs" />
<Compile Include="JsonIO\Table\CompositeCell.fs" />
<Compile Include="JsonIO\Table\IOType.fs" />
<Compile Include="JsonIO\Table\CompositeHeader.fs" />
<Compile Include="JsonIO\Table\ArcTable.fs" />
<Compile Include="JsonIO\Table\Templates.fs" />
<Compile Include="JsonIO\DataMap\DataMap.fs" />
<Compile Include="JsonIO\Assay.fs" />
<Compile Include="JsonIO\Study.fs" />
<Compile Include="JsonIO\Investigation.fs" />
<Compile Include="JsonIO\ROCrateObject.fs" />
<Compile Include="JsonIO\ARC.fs" />
<None Include="README.md" />
</ItemGroup>

<ItemGroup>
<Content Include="ARCtrl.Common.props" Pack="true" PackagePath="fable/"/>
<Compile Include="WebRequest\WebRequest.Py.fs" />
<Compile Include="WebRequest\WebRequest.fs" />
<Compile Include="Template.Web.fs" />
Expand Down
48 changes: 46 additions & 2 deletions src/ARCtrl/ARCtrl.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,52 @@
<Import Project="../Package.Metadata.props" />

<Import Project="ARCtrl.Common.props" />
<ItemGroup>
<None Include="ARCtrl.Common.props" />

<ItemGroup>
<Compile Include="JsonIO\Decode.fs" />
<Compile Include="JsonIO\Encode.fs" />
<Compile Include="JsonIO\Comment.fs" />
<Compile Include="JsonIO\OntologyAnnotation.fs" />
<Compile Include="JsonIO\OntologySourceReference.fs" />
<Compile Include="JsonIO\DataFile.fs" />
<Compile Include="JsonIO\Data.fs" />
<Compile Include="JsonIO\Person.fs" />
<Compile Include="JsonIO\Publication.fs" />
<Compile Include="JsonIO\Process\Value.fs" />
<Compile Include="JsonIO\Process\Factor.fs" />
<Compile Include="JsonIO\Process\FactorValue.fs" />
<Compile Include="JsonIO\Process\ProtocolParameter.fs" />
<Compile Include="JsonIO\Process\MaterialType.fs" />
<Compile Include="JsonIO\Process\MaterialAttribute.fs" />
<Compile Include="JsonIO\Process\Component.fs" />
<Compile Include="JsonIO\Process\Protocol.fs" />
<Compile Include="JsonIO\Process\MaterialAttributeValue.fs" />
<Compile Include="JsonIO\Process\Material.fs" />
<Compile Include="JsonIO\Process\Source.fs" />
<Compile Include="JsonIO\Process\Sample.fs" />
<Compile Include="JsonIO\Process\ProcessParameterValue.fs" />
<Compile Include="JsonIO\Process\ProcessInput.fs" />
<Compile Include="JsonIO\Process\ProcessOutput.fs" />
<Compile Include="JsonIO\Process\Process.fs" />
<Compile Include="JsonIO\Process\ProcessSequence.fs" />
<Compile Include="JsonIO\Process\StudyMaterials.fs" />
<Compile Include="JsonIO\Table\Compression.fs" />
<Compile Include="JsonIO\Table\CompositeCell.fs" />
<Compile Include="JsonIO\Table\IOType.fs" />
<Compile Include="JsonIO\Table\CompositeHeader.fs" />
<Compile Include="JsonIO\Table\ArcTable.fs" />
<Compile Include="JsonIO\Table\Templates.fs" />
<Compile Include="JsonIO\DataMap\DataMap.fs" />
<Compile Include="JsonIO\Assay.fs" />
<Compile Include="JsonIO\Study.fs" />
<Compile Include="JsonIO\Investigation.fs" />
<Compile Include="JsonIO\ROCrateObject.fs" />
<Compile Include="JsonIO\ARC.fs" />
<None Include="README.md" />
</ItemGroup>

<ItemGroup>
<Content Include="ARCtrl.Common.props" Pack="true" PackagePath="fable/" />
<Compile Include="WebRequest\WebRequest.fs" />
<Compile Include="Template.Web.fs" />
<Compile Include="ARC.fs" />
Expand Down
Loading
Loading