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

Add test coverage to CI #128

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
711156d
Add unit test skeleton
networkfusion Apr 12, 2022
25b52c2
Update build image
networkfusion Apr 12, 2022
eef6f8f
Build image concurency.
networkfusion Apr 12, 2022
e34bc9a
Add Code Coverage
networkfusion Apr 12, 2022
a8b2dff
Correct variable name
networkfusion Apr 12, 2022
ebae9fa
Merge branch 'add-unittest-skeleton' into add-test-code-coverage
networkfusion Apr 12, 2022
ebaf549
Correct name
networkfusion Apr 14, 2022
1b3c67a
Merge branch 'add-test-code-coverage' of https://github.com/nanoframe…
networkfusion Apr 14, 2022
877643d
Update image version
networkfusion Apr 14, 2022
daf229a
Merge branch 'add-unittest-skeleton' into add-test-code-coverage
networkfusion Apr 14, 2022
dc1420a
Merge branch 'add-test-code-coverage' of https://github.com/nanoframe…
networkfusion Apr 14, 2022
4e13f85
Fix multiple file warning.
networkfusion Jul 12, 2022
3a443a0
Fix the fix
networkfusion Jul 12, 2022
5233ebf
Continue on test error
networkfusion Jul 12, 2022
a4b5885
Fix yaml
networkfusion Jul 12, 2022
d4f70bc
Further fix to yaml
networkfusion Jul 12, 2022
16889bd
Use wrap option
networkfusion Jul 12, 2022
062c81a
Fix location of coverage report
networkfusion Jul 12, 2022
6f3c156
Fail on test fail
networkfusion Jul 12, 2022
9afdfbb
Merge branch 'main' into add-test-code-coverage
networkfusion Dec 19, 2022
bbd1205
Update CloudsmithApiTests.cs
networkfusion Dec 19, 2022
768efc2
Update FirmwarePackageTests.cs
networkfusion Dec 19, 2022
223a168
Improve CI task name
networkfusion Dec 19, 2022
41ba0a3
Update CloudsmithApiTests.cs
networkfusion Dec 19, 2022
45b9c70
Merge branch 'main' into add-test-code-coverage
networkfusion Apr 20, 2023
c886de9
Merge branch 'main' into add-test-code-coverage
networkfusion Jun 1, 2023
e116b8f
Merge branch 'main' into add-test-code-coverage
networkfusion Aug 23, 2023
fa19eef
Merge branch 'main' into add-test-code-coverage
networkfusion Jan 4, 2024
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
27 changes: 27 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,33 @@ jobs:
eq(variables['UPDATE_DEPENDENTS'], 'false')
)


##################################################

- task: DotNetCoreCLI@2
displayName: 'Run Solution Tests'
inputs:
command: test
projects: |
./nanoFirmwareFlasher.Tests/nanoFirmwareFlasher.Tests.csproj
arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage"'

# First install the tool on the machine, then run it
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Agent.WorkFolder)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage "-reporttypes:HtmlInline_AzurePipelines;Cobertura"
displayName: 'Create code coverage report'
condition: always()

- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/Cobertura.xml'
condition: always()

##################################################

- task: NuGetCommand@2
condition: >-
and(
Expand Down
14 changes: 9 additions & 5 deletions nanoFirmwareFlasher.Tests/CloudsmithApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,30 @@ public class CloudsmithApiTests
[TestMethod]
public void CheckApiUriExists()
{
Assert.IsTrue(false);
// FIXME: test is not available.
//Assert.IsTrue(false);
}

[TestMethod]
public void CheckApiVersionExists()
{
// FIXME: test is not available.
// And is not deprecated?!
Assert.IsTrue(false);
//Assert.IsTrue(false);
}

[TestMethod]
public void DecodePackageDetails()
{
Assert.IsTrue(false);
// FIXME: test is not available.
//Assert.IsTrue(false);
}

[TestMethod]
public void DecodePackageInformation()
{
Assert.IsTrue(false);
// FIXME: test is not available.
//Assert.IsTrue(false);
}
}
}
}
12 changes: 8 additions & 4 deletions nanoFirmwareFlasher.Tests/FirmwarePackageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@ public class FirmwarePackageTests
[TestMethod]
public void ListReferenceTargets()
{
Assert.IsTrue(false);
// FIXME: test is not available.
//Assert.IsTrue(false);
}

[TestMethod]
public void ListCommunityTargets()
{
Assert.IsTrue(false);
// FIXME: test is not available.
//Assert.IsTrue(false);
}

[TestMethod]
public void DownloadReferenceTarget()
{
Assert.IsTrue(false);
// FIXME: test is not available.
//Assert.IsTrue(false);
}

[TestMethod]
public void DownloadCommunityTarget()
{
Assert.IsTrue(false);
// FIXME: test is not available.
//Assert.IsTrue(false);
}
}
}