Skip to content

Commit

Permalink
Merge pull request #462 from FirelyTeam/428-run-integration-tests-in-…
Browse files Browse the repository at this point in the history
…build

428 run integration tests in build
  • Loading branch information
richfirely authored Aug 15, 2024
2 parents 3ff951e + a6941bd commit 890550b
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 95 deletions.
77 changes: 17 additions & 60 deletions Cql-Sdk-All.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cql/CoreTests/CoreTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<!-- <TestResultsDirectory>$(MSBuildProjectDirectory)/input/tests/results</TestResultsDirectory> -->
</PropertyGroup>

<Import Project="$(MSBuildProjectDirectory)..\..\..\Demo\Cql\Build\CqlToElm.Targets.xml" />
<!-- <Import Project="$(MSBuildProjectDirectory)..\..\..\Demo\Cql\Build\CqlToElm.Targets.xml" /> -->

<ItemGroup>
<None Include="Input\ELM\HL7\*.json">
Expand Down
4 changes: 0 additions & 4 deletions Cql/Cql.Compiler/Cql.Compiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Dumpify" Version="0.6.6" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Cql.Logging\Cql.Logging.csproj" />
<ProjectReference Include="..\Cql.Model\Cql.Model.csproj" />
Expand Down
1 change: 1 addition & 0 deletions Cql/PackagerCLI/OptionsConsoleDumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void DumpToConsole()
WriteLine("PackageCLI");
WriteLine("- Environment -----------------------------------");
WriteLine($"{"Current Directory",-45} : {Environment.CurrentDirectory}");
WriteLine($"{"DOTNET_ENVIRONMENT",-45} : {Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT")}");
WriteLine("- Arguments Provided ----------------------------");
(string name, object? value)[] values = new[]
{
Expand Down
9 changes: 8 additions & 1 deletion Demo/CLI/CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>

<ItemGroup >
<PackageReference Include="Dumpify" Version="0.6.6" />
<PackageReference Condition=" '$(DefineConstants.Contains(RELEASE))' " Include="StrongNamer" Version="0.2.5" />
<!--
Since Dumpify is not a strongly named assembly, we need to use StrongNamer to make it work when building the CLI.
-->
<PackageReference Include="StrongNamer" Version="0.2.5" />
</ItemGroup>

<!--<ItemGroup Condition="'$(Configuration)'!='Release'" >
<PackageReference Include="Dumpify" Version="0.6.6" />
</ItemGroup>-->

</Project>
57 changes: 35 additions & 22 deletions Demo/Cql/Build/ElmToCSharp.Targets.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>

<Project>

<!-- Turn off visual studio msbuild automatics -->
Expand All @@ -10,27 +11,34 @@
<CqlSolutionDir>$(MSBuildProjectDirectory)/../../</CqlSolutionDir>
</PropertyGroup>

<Target Name="StartMessage"
BeforeTargets="PreBuildEvent">
<Message Text="$(Box.Replace(Text, $(LibrarySet) Starting... ))" Importance="High" />
</Target>

<!-- ELM to CSharp -->
<PropertyGroup>
<CSharpDirectory>$(MSBuildProjectDirectory)/CSharp</CSharpDirectory>
<!-- Use CqlSolutionDir instead of SolutionDir, because this file is used in different solutions across repos -->
<PackagerCLI>$(CqlSolutionDir)Cql/PackagerCLI/bin/$(Configuration)/$(TargetFramework)/Hl7.Cql.Packager.exe</PackagerCLI>

<!-- Comment out these if you don't need them -->
<CanonicalRootUrl>https://fire.ly/fhir/</CanonicalRootUrl>
<CSharpTypeFormat>explicit</CSharpTypeFormat> <!--CSharpTypeFormat: explicit|var -->
</PropertyGroup>

<Target Name="GenerateCSharp"
Condition="Exists('$(PackagerCLI)')"
BeforeTargets="PreBuildEvent">
<!-- DependsOnTargets="CQLtoELM" -->
<!-- DependsOnTargets="GenerateAdditionalSources" -->
<!-- Condition="'$(CQLtoElmRan)'=='true'" -->
<!-- BeforeTargets="PreBuildEvent" -->
<!--
NOTE: This needs some work still
DependsOnTargets="CQLtoELM"
Condition="'$(CQLtoElmRan)'=='true'"
BeforeTargets="PreBuildEvent">
Condition="'$(CQLtoElmRan)'=='true'"-->

<Message Text="$(Box.Replace(Text, $(LibrarySet) Starting on Configuration '$(Configuration)' ))" Importance="High" />

<PropertyGroup>
<!-- Use CqlSolutionDir instead of SolutionDir, because this file is used in different solutions across repos -->
<PackagerCLI>$(CqlSolutionDir)Cql/PackagerCLI/bin/debug/$(TargetFramework)/Hl7.Cql.Packager.exe</PackagerCLI>
<CSharpDirectory>$(MSBuildProjectDirectory)/CSharp</CSharpDirectory>

<!-- Comment out these if you don't need them -->
<CanonicalRootUrl>https://fire.ly/fhir/</CanonicalRootUrl>
<CSharpTypeFormat>explicit</CSharpTypeFormat>
<!--CSharpTypeFormat: explicit|var -->

<!-- Leave these alone, they are automatically picked up from the properties above -->
<PackagerCLIArgs Condition="'$(OverrideUtcDateTime)'!=''">$(PackagerCLIArgs) --override-utc-date-time "$(1970-01-01T00:00:00Z)"</PackagerCLIArgs>
Expand All @@ -43,33 +51,38 @@
<PackagerCLICommand>$(PackagerCLI) $(PackagerClIArgs)</PackagerCLICommand>
<!-- <PackagerCLICommand>$(PackagerCLI) $(PackagerClIArgs) &gt; NUL 2&gt; NUL</PackagerCLICommand> -->
</PropertyGroup>
<!-- Remove assets about to be created to avoid duplicates when editing/renaming CQL files -->

<!--
~1~ Remove assets about to be created to avoid duplicates when editing/renaming CQL files @1@
<ItemGroup>
<!-- Keep relative path else complains about duplicates in msbuild meta tracking-->
~1~ Keep relative path else complains about duplicates in msbuild meta tracking@1@
<CSharpFiles Include="CSharp/**/*.cs" />
<ResourceFiles Include="$(ResourcesDirectory)/*.json" />
</ItemGroup>
<Delete Files="@(CSharpFiles)" />
<Delete Files="@(ResourceFiles)" />
<Message Text="$(Box.Replace(Text, $(LibrarySet) Converting ELM to CSharp&#10;$(PackagerCLICommand)))" Importance="High" />
-->

<Message Text="$(Box.Replace(Text, $(LibrarySet) Converting ELM to CSharp&#10;$(PackagerCLICommand)))"
Importance="High" />
<Exec Command='$(PackagerCLICommand)' />

<ItemGroup>
<!-- Keep relative path else complains about duplicates-->
<CSharpFiles Include="CSharp/**/*.cs" />
<Compile Include="@(CSharpFiles)" Exclude="@(Compile)" KeepDuplicates="false"/>
<Compile Include="@(CSharpFiles)" Exclude="@(Compile)" KeepDuplicates="false" />
</ItemGroup>

<!-- Touch CQL files if error so build will try again-->
<OnError ExecuteTargets="TouchFiles" />
</Target>

<Target Name="TouchFiles">
<Touch
Files="@(CqlFiles)">
<Touch Files="@(CqlFiles)">
<Output
TaskParameter="TouchedFiles"
ItemName="FilesTouched"/>
TaskParameter="TouchedFiles"
ItemName="FilesTouched" />
</Touch>
</Target>

Expand Down
1 change: 1 addition & 0 deletions Demo/Cql/Build/Mvn.Targets.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project>

<!-- Download MVN Dependencies -->
<PropertyGroup>
<!-- If you change the version here, you also need to update it in the pom.xml file -->
Expand Down
3 changes: 2 additions & 1 deletion Demo/Cql/Cql.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\cql-demo.props" />
<Import Project="Build\Mvn.Targets.xml" />
<!-- <Import Project="Build\Mvn.Targets.xml" /> -->

<ItemGroup>
<ProjectReference Include="..\..\Cql\PackagerCLI\PackagerCLI.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion Demo/Measures.Authoring/Measures.Authoring.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<TestResultsDirectory>$(MSBuildProjectDirectory)/input/tests/results</TestResultsDirectory>
</PropertyGroup>

<Import Project="../Cql/Build/CqlToElm.Targets.xml" />
<!-- <Import Condition="false" Project="../Cql/Build/CqlToElm.Targets.xml" /> -->
<Import Project="../Cql/Build/ElmToCSharp.Targets.xml" />

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Demo/Measures.CMS/Measures.CMS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<TestResultsDirectory>$(MSBuildProjectDirectory)/input/tests/results</TestResultsDirectory>
</PropertyGroup>

<Import Project="../Cql/Build/CqlToElm.Targets.xml" />
<!-- <Import Condition="false" Project="../Cql/Build/CqlToElm.Targets.xml" /> -->
<Import Project="../Cql/Build/ElmToCSharp.Targets.xml" />

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Demo/Measures.Demo/Measures.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<TestResultsDirectory>$(MSBuildProjectDirectory)/input/tests/results</TestResultsDirectory>
</PropertyGroup>

<Import Project="../Cql/Build/CqlToElm.Targets.xml" />
<!-- <Import Condition="false" Project="../Cql/Build/CqlToElm.Targets.xml" /> -->
<Import Project="../Cql/Build/ElmToCSharp.Targets.xml" />

<ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion build/templates/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ parameters:
zipAfterPublish: false
checkoutSubmodules: true
pool: {}
solutionFile: 'Cql-Sdk-and-Demo.slnf' # also in build.yml and package.yml
solutionFile: 'Cql-Sdk-All.sln' # also in build.yml and package.yml

jobs:
- job: Build
Expand Down Expand Up @@ -64,6 +64,13 @@ jobs:
projects: '**/*Tests/*Tests.csproj'
arguments: '--configuration $(buildConfiguration) --no-build --no-restore'

- task: DotNetCoreCLI@2
displayName: 'dotnet test Integration Tests against CMS Meassures'
inputs:
command: test
projects: 'submodules\Firely.Cql.Sdk.Integration.Runner\IntegrationRunner\IntegrationRunner.csproj'
arguments: '--configuration $(buildConfiguration) --no-build --no-restore'

- template: sign-dlls-template.yml

- ${{ if eq(parameters.packageArtifacts, 'true') }}:
Expand Down
2 changes: 1 addition & 1 deletion build/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Variables used during builds.

variables:
buildConfiguration: 'Release'
buildConfiguration: '"Release"'
vmImage: 'windows-latest'
DOTNET_CORE_SDK: '8.0.x'
GITHUB_PACKAGES_APIKEY: $(GitHubPushPackagesAPIKey) # key is set in variable group APIKeys
Expand Down
2 changes: 1 addition & 1 deletion submodules/Firely.Cql.Sdk.Integration.Runner

0 comments on commit 890550b

Please sign in to comment.