Skip to content

On every pull request, TimeTick runs your test on a simulator connected to your CSMS on staging. If the test fails, so does the job.

The CI action starts a test run and fails the job when it fails.

  1. Create a simulator for your staging CSMS and run a test on it in the portal until it passes.
  2. Save an API key as the secret TIMETICK_API_TOKEN.
  3. Note three numbers from the address bar in the portal:
Id Address
Project app.timetick.io/projects/<project id>
Test .../tests/<test id>
Simulator .../simulators/<simulator id>

Save this as .github/workflows/timetick.yml and put in your ids:

name: TimeTick OCPP tests
on:
pull_request:
workflow_dispatch:
concurrency:
group: timetick
jobs:
ocpp-tests:
runs-on: ubuntu-latest
steps:
- name: Run the TimeTick test
uses: TimeTickIO/timetick-ci@v1
with:
api-key: ${{ secrets.TIMETICK_API_TOKEN }}
project-id: "123"
test-id: "456"
simulators: "789"

To test a branch, deploy it to staging before this step. The job page shows a table with the results.

Save the key as a masked variable named TIMETICK_API_TOKEN, then add:

stages:
- test
include:
- component: gitlab.com/TimeTickIO/timetick-ci/run-test@1.0.0
inputs:
version: "1.0.0"
project-id: "123"
test-id: "456"
simulators: "789"

Results appear in the Tests tab of the merge request.

You need Node.js 20:

Terminal window
wget -qO timetick.js https://gitlab.com/TimeTickIO/timetick-ci/-/raw/1.0.0/dist/index.js
INPUT_PROJECT_ID=123 INPUT_TEST_ID=456 INPUT_SIMULATORS=789 node timetick.js

It exits with 0 when the test passes.

A simulator runs one test at a time, so give each pipeline its own. All options are in the timetick-ci repository.