Skip to the content.

Testing and CI Setup

The Asset Tracker Template features a comprehensive testing infrastructure with tests run both on real hardware (on target) and emulation. Code analysis is performed through compliance checks and SonarCloud analysis.

CI Pipeline Structure

The CI pipeline is composed by the following workflows:

Additionally we are using AI assistant in .github/workflows/ai-review.yaml. It’s an AI reviewer that runs on pull request. Developer can choose to run it or not with a label.

The CI pipeline is triggered as follows:

Hardware Tests

Run by .github/workflows/target-test.yml workflow, implementation details in tests/on_target folder.

Tests on target are performed using self-hosted runners. How to set up your own instance for your project: About Self Hosted

Try out tests locally: tests/on_target/README.md

Emulated Target Tests

Emulation tests are implemented as part of the SonarCloud workflow (.github/workflows/sonarcloud.yml). These tests:

SonarCloud Analysis

The SonarCloud integration (.github/workflows/sonarcloud.yml) provides:

Compliance Testing

Compliance checks are implemented in .github/workflows/compliance.yml and include:

Key Features

  1. Modularity: Each aspect of testing is handled by a dedicated workflow
  2. Comprehensive Coverage: Combines hardware testing, emulation, and static analysis
  3. Detailed Reporting: Generates test reports, coverage data, and compliance checks
  4. Flexibility: Supports different test configurations and target devices
  5. Quality Assurance: Multiple layers of validation ensure code quality

Test Results and Artifacts

Each workflow generates specific artifacts:

Artifacts are available in the GitHub Actions interface and can be used for debugging and quality assurance purposes.