https://github.com/gregk27/frc-ci-demo
Sample continuous integration setup for FIRST Robotics Competition
https://github.com/gregk27/frc-ci-demo
continuous-integration frc
Last synced: about 1 month ago
JSON representation
Sample continuous integration setup for FIRST Robotics Competition
- Host: GitHub
- URL: https://github.com/gregk27/frc-ci-demo
- Owner: gregk27
- Created: 2020-07-30T16:55:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-12T21:47:16.000Z (almost 6 years ago)
- Last Synced: 2025-01-22T23:11:33.289Z (over 1 year ago)
- Topics: continuous-integration, frc
- Language: Java
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# CI Demo
This is a repository with setup that features 3 CI components for an FRC Java robot
- Build: Verifies result of `gradlew build -x tests`
- Tests: Unit tests
- Syntax: Checkstyle check
# Tests
This executes JUnit tests located in `src/test/java/frc/robot` in four steps. They are run from lowest level (subsystems interfacing with hardware) to highest level (full robot).
For mocking FRC hardware, a variety of wrappers are included from https://github.com/gregk27/FRCMocks. These allow for tracking a variety of parameters such as motor controller setpoints, and solenoid values.
To implement unit tests outside of `src/java/main`, they must be added to the `.classpath` file (hidden by default in vscode). This can be done with the following snippet:
```XML
```
## Subsystems
Subsystem tests include all tests under `robot/subystems`. These tests verify that subsystem functions interface properly with mock hardware. Ex. `Intake.deploy()` actually deploys the intake.
## Commands
Commands tests inlcude all tests under `robot/commands` (excluding `robot/commands/autonomous`). These tests verify that commands have the intended effects on their respective subsystems. Ex: `IntakeCommand` both deploys and starts the intake on button press, then stops/retracts on release.
### Autonomous commands
Autonomous command tests inlucde all tests under `robot/commands/autonomous`, these are run after commands as most depend on commands.
## Sim
Sim tests are tests at the top level (directly under `robot`). These tests may depend on a combination of subsystems and commands, and are therefore run last.
# Syntax
Syntax tests are run using [Checkstyle](https://checkstyle.sourceforge.io/), a highly configurable linter. These tests allow for enforcing code standards to increase consistency and legibilty. The configuration in this repository is `/checkstyle.xml`. These tests can be run manually with the command `gradlew checkstyle`, and syntax highlighting can be applied with a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-checkstyle).