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

Adding hardware test #351

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b605096
Adding hardware test
Ellerbach Oct 14, 2024
20ed2bc
updating benchmark packages
Ellerbach Oct 14, 2024
d0c1ab2
Merge branch 'main' into add-hardware-tests
Ellerbach Oct 14, 2024
00f9e1d
adjusting to point on template
Ellerbach Oct 14, 2024
679e46b
Merge branch 'add-hardware-tests' of https://github.com/nanoframework…
Ellerbach Oct 14, 2024
bd361a0
adjusting paths
Ellerbach Oct 14, 2024
5af0ba5
adjusting test names
Ellerbach Oct 14, 2024
a982d02
adjusting for Unix based file name
Ellerbach Oct 14, 2024
1962af4
Merge branch 'main' into add-hardware-tests
josesimoes Oct 14, 2024
b9ab875
asjusting for new adapter and path
Ellerbach Oct 16, 2024
2aa239a
Merge branch 'add-hardware-tests' of https://github.com/nanoframework…
Ellerbach Oct 16, 2024
9041b38
adjusting runsettings
Ellerbach Oct 16, 2024
7e7818d
adding boostrap
Ellerbach Oct 31, 2024
727367b
Merge branch 'main' into add-hardware-tests
Ellerbach Oct 31, 2024
c97f0ab
Merge branch 'main' into add-hardware-tests
Ellerbach Dec 17, 2024
3342e62
simplifying bootstrap using the template
Ellerbach Dec 17, 2024
9236f0e
fixing nit in templates
Ellerbach Dec 17, 2024
bf05b05
nit
Ellerbach Dec 17, 2024
6c5ce4e
update nuget
Ellerbach Dec 17, 2024
60c22e9
nit
Ellerbach Dec 17, 2024
7595bb9
Merge branch 'main' into add-hardware-tests
josesimoes Dec 17, 2024
06a9889
Minor changes in AZDO pipeline YAML
josesimoes Dec 18, 2024
a43ad17
Dummy change to trigger build
josesimoes Dec 18, 2024
23e0e89
Revert "Dummy change to trigger build"
josesimoes Dec 18, 2024
1958f63
Fix comment and layout
josesimoes Dec 19, 2024
d439b3a
Merge branch 'main' into add-hardware-tests
josesimoes Dec 19, 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
42 changes: 42 additions & 0 deletions azure-bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.

trigger:
branches:
include:
- main
- develop
- release-*
paths:
exclude:
- .gitignore
- CHANGELOG.md
- LICENSE.md
- README.md
- NuGet.Config
- assets/*
- .github/*

josesimoes marked this conversation as resolved.
Show resolved Hide resolved
# PR always trigger build
pr:
autoCancel: true

Ellerbach marked this conversation as resolved.
Show resolved Hide resolved
# add nf-tools repo to resources (for Azure Pipelines templates)
resources:
repositories:
- repository: templates
type: github
name: nanoframework/nf-tools
endpoint: nanoframework

Ellerbach marked this conversation as resolved.
Show resolved Hide resolved
jobs:
- job: Trigger
displayName: Trigger Azure Dev Ops build and test pipeline
pool:
vmImage: 'ubuntu-latest'

steps:
- template: azure-pipelines-templates/device-bootstrap.yml@templates
parameters:
AZURE_DEVOPS_PROJECT: nanoFramework.Json
AZURE_DEVOPS_PIPELINE_ID: 59
Ellerbach marked this conversation as resolved.
Show resolved Hide resolved
85 changes: 48 additions & 37 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.

trigger:
branches:
include:
- main
- develop
- release-*
paths:
exclude:
- .github_changelog_generator
- .gitignore
- CHANGELOG.md
- CODE_OF_CONDUCT.md
- LICENSE.md
- README.md
- NuGet.Config
- assets/*
- config/*
- .github/*

# PR always trigger build
pr:
autoCancel: true
# The Pipeline is going to be called by the GitHub action.
# Manual trigger is always possible.
trigger: none
pr: none
josesimoes marked this conversation as resolved.
Show resolved Hide resolved

# add nf-tools repo to resources (for Azure Pipelines templates)
resources:
Expand All @@ -48,20 +30,49 @@ variables:
- name: nugetPackageName
value: 'nanoFramework.Json'

steps:
parameters:
- name: appComponents
displayName: List of capabilities to run the tests on
type: object
default:
- none

Comment on lines +33 to +39
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Improve parameter configuration and validation.

The default value of none for appComponents could lead to scenarios where no tests are executed, which aligns with the reported issue in PR comments about catching missing tests.

Consider these improvements:

  1. Add parameter validation to prevent empty or 'none' values
  2. Enhance the parameter description to list valid component options
  3. Add a minimum number of required components

Here's a suggested improvement:

 parameters:
 - name: appComponents
   displayName: List of capabilities to run the tests on
   type: object
+  # List of valid components: [component1, component2, ...]
+  # At least one component must be specified
   default:
-    - none
+    - required: true
+    - allowed:
+      - component1
+      - component2

Committable suggestion was skipped due to low confidence.

🧰 Tools
🪛 yamllint

[warning] 34-34: wrong indentation: expected 2 but found 0

(indentation)

stages:
- stage: Build
displayName: 'Build'
jobs:
- job: Build
displayName: 'Build job'
pool:
# default is the following VM Image
vmImage: 'windows-latest'
steps:

# step from template @ nf-tools repo
# all build, update and publish steps
- template: azure-pipelines-templates/class-lib-build.yml@templates
parameters:
sonarCloudProject: 'nanoframework_lib-nanoFramework.Json'
runUnitTests: true
unitTestRunsettings: '$(System.DefaultWorkingDirectory)\.runsettings'

# step from template @ nf-tools repo
# report error
- template: azure-pipelines-templates/discord-webhook-task.yml@templates
parameters:
status: 'failure'
webhookUrl: '$(DiscordWebhook)'
message: ''

# step from template @ nf-tools repo
# all build, update and publish steps
- template: azure-pipelines-templates/class-lib-build.yml@templates
parameters:
sonarCloudProject: 'nanoframework_lib-nanoFramework.Json'
runUnitTests: true
unitTestRunsettings: '$(System.DefaultWorkingDirectory)\.runsettings'
- task: PublishPipelineArtifact@1
displayName: Publish Pipeline Artifact copy
inputs:
path: '$(System.DefaultWorkingDirectory)'
artifactName: 'Artifacts'

# step from template @ nf-tools repo
# report error
- template: azure-pipelines-templates/discord-webhook-task.yml@templates
parameters:
status: 'failure'
webhookUrl: '$(DiscordWebhook)'
message: ''
- ${{ each appComponents in parameters.appComponents }}:
- template: azure-pipelines-templates/device-test.yml@templates
parameters:
appComponents: ${{ appComponents }}
unitTestRunsettings:
- 'nanoFramework.Json.Test/nano.runsettings,nanoFramework.Json.Test/bin/Release/NFUnitTest.dll'
josesimoes marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions nanoFramework.Json.Test/nano.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
<nanoFrameworkAdapter>
<Logging>None</Logging>
<IsRealHardware>False</IsRealHardware>
<RealHardwarePort>COM3</RealHardwarePort>
</nanoFrameworkAdapter>
</RunSettings>