Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8a97626
fix: checking out correct repository (fork) on pull request (#8)
xBlaz3kx Jul 25, 2025
ef7c8d0
chore: improve error handling (avoid panicking), returns an error ins…
xBlaz3kx Jul 25, 2025
4777e7b
feat: websocket compression (#11)
xBlaz3kx Jul 25, 2025
70bc3d1
Feature: OCPP 1.6 config manager (#12)
xBlaz3kx Jul 25, 2025
acd9d3e
docs: update readme (#13)
xBlaz3kx Jul 25, 2025
ea930cc
Merge branch 'lorenzodonini:master' into main
xBlaz3kx Aug 17, 2025
80fd5a4
Feat: Observability (#16)
xBlaz3kx Aug 31, 2025
78d7305
Feat: Profiling (#14)
xBlaz3kx Aug 31, 2025
a84f16d
fix: improve connection removal by actually deleting the connection f…
xBlaz3kx Dec 26, 2025
4246157
chore: bump mockery (#20)
xBlaz3kx Dec 27, 2025
b6f2f75
feat: k6 actions (#19)
xBlaz3kx Dec 27, 2025
fdfd08f
fix: improving thread safety (#21)
xBlaz3kx Dec 28, 2025
a6a3f22
chore: use suite assertions instead of package assertions (#22)
xBlaz3kx Dec 28, 2025
6abea91
chore: add tests for ocpp package (#23)
xBlaz3kx Dec 28, 2025
a353a00
fix: tests (#25)
xBlaz3kx Dec 28, 2025
4b78d8e
fix: use suite assertions in ocpp 1.6 and 2.0.1 packages (#26)
xBlaz3kx Dec 28, 2025
33db15b
docs: ocpp 1.6 manager example docs (#27)
xBlaz3kx Dec 29, 2025
18f9e70
chore: callback queue tests (#28)
xBlaz3kx Dec 29, 2025
9a52d65
chore: refactor logging (#29)
xBlaz3kx Dec 29, 2025
a6c7e41
chore: rename module reference (#30)
xBlaz3kx Dec 29, 2025
7b0fc74
chore: make makefile a bit more generic (#31)
xBlaz3kx Dec 30, 2025
d426e28
fix: remove mutex and use atomic int for connected charge points metr…
xBlaz3kx Dec 31, 2025
bd2e7c6
Bump actions/upload-artifact from 4 to 6 (#34)
dependabot[bot] Dec 31, 2025
a0a2fc5
Bump actions/setup-go from 5 to 6 (#39)
dependabot[bot] Dec 31, 2025
7c980d9
Bump actions/download-artifact from 4 to 7 (#37)
dependabot[bot] Dec 31, 2025
3723a22
Bump jaxxstorm/action-install-gh-release from 1.10.0 to 2.1.0 (#33)
dependabot[bot] Dec 31, 2025
26dc8fc
Bump gopkg.in/go-playground/validator.v9 from 9.30.0 to 9.31.0 (#41)
dependabot[bot] Dec 31, 2025
46437cd
Bump actions/checkout from 4 to 6 (#35)
dependabot[bot] Dec 31, 2025
6d68aef
chore(deps): bump stefanzweifel/git-auto-commit-action from 5 to 7 (#45)
dependabot[bot] Jan 1, 2026
7dcb5d6
fix: improve server and client state locking with read locks (#46)
xBlaz3kx Jan 1, 2026
4888f40
chore: refactor charge point and csms creation signature to propagate…
xBlaz3kx Jan 1, 2026
1b78d33
Bump the go_modules group across 1 directory with 2 updates (#44)
dependabot[bot] Jan 1, 2026
ccf560f
feat: add benchmarks to ci
xBlaz3kx Jan 2, 2026
644f972
feat: add request queues bench
xBlaz3kx Jan 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 9 additions & 6 deletions .github/workflows/autogen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
paths-ignore:
- '*.md'
- 'example/**'
- 'docs/**'
- 'Makefile'

jobs:
mockery:
Expand All @@ -18,34 +21,34 @@ jobs:

steps:
- name: Checkout (pull request)
uses: actions/checkout@v4
uses: actions/checkout@v6
if: github.event_name == 'pull_request'
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Checkout (default)
uses: actions/checkout@v4
uses: actions/checkout@v6
if: github.event_name != 'pull_request'
with:
ref: ${{ github.head_ref }}

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: 1.17

- name: Install Mockery
uses: jaxxstorm/action-install-gh-release@v1.10.0
uses: jaxxstorm/action-install-gh-release@v2.1.0
with: # Grab a specific tag
repo: vektra/mockery
tag: v2.51.0
tag: v2.53.5

- name: Generate mocks
run: mockery

# Commit all changed files back to the repository
- uses: stefanzweifel/git-auto-commit-action@v5
- uses: stefanzweifel/git-auto-commit-action@v7
#with:
# commit_message: [ Autogen ] Generated mocks
# # Mockery can generate new files, so we need to add them to the commit as well
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Benchmarks
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
# Only run the benchmark on internals
- 'internal/**'
- 'ocppj/**'
- 'ws/**'
- 'go.mod'

jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
permissions:
contents: read
# Needed for posting comments on PRs
pull-requests: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "stable"

- name: Run benchmarks
run: make benchmarks

# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
# Run `github-action-benchmark` action
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: 'go'
# Where the output from the benchmark tool is stored
output-file-path: benchmarks.txt
# Where the previous data file is stored
external-data-json-path: ./cache/benchmark-data.json
# Workflow will fail when an alert happens
fail-on-alert: false
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Always post a comment on the PR with benchmark results
comment-always: 'true'
# Enable alert commit comment
comment-on-alert: true
# Enable Job Summary for PRs
summary-always: true
53 changes: 0 additions & 53 deletions .github/workflows/docker-publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
Expand Down
69 changes: 59 additions & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ on:
- LICENSE

workflow_dispatch:

jobs:
unit:
runs-on: ubuntu-latest
name: Unit tests
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6
- name: Run tests
run: |
docker compose -f docker-compose.test.yaml up unit_test --abort-on-container-exit
make unit-tests
- name: Archive code coverage results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: unit_coverage_${{ github.sha }}
path: ./coverage.out
Expand All @@ -34,33 +33,83 @@ jobs:
needs: unit
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6
- name: Download coverage from unit tests
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: unit_coverage_${{ github.sha }}
- name: Run integration tests
run: |
docker compose -f docker-compose.test.yaml up integration_test --abort-on-container-exit
make integration-tests
- name: Merge coverage
run: |
sed '1d;$d' integration_coverage.out >> coverage.out
- name: Archive code coverage results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: coverage_${{ github.sha }}
path: ./coverage.out

performance:
name: Performance tests
runs-on: ubuntu-latest
permissions:
pull-requests: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Run OCPP 1.6 performance tests
id: ocpp16-perf-test
run: |
make perf-tests-ocpp16-ci
echo "SUMMARY_16=$(jq -r '${{ github.workspace }}/results' summary_16.json)" >> "$GITHUB_OUTPUT"

- name: Run OCPP 2.0.1 performance tests
id: ocpp201-perf-test
run: |
make perf-tests-ocpp201-ci
echo "SUMMARY_201=$(jq -r '${{ github.workspace }}/results' summary_201.json)" >> "$GITHUB_OUTPUT"

- name: Report performance test results
uses: actions/upload-artifact@v6
with:
path: ${{ github.workspace }}/results
name: performance_test_results_${{ github.sha }}
retention-days: 14

- name: Post summary to PR
continue-on-error: true
uses: thollander/actions-comment-pull-request@v3
if: github.event_name == 'pull_request'
with:
message: |
## Performance Test Results

### OCPP 1.6
```json
${{steps.ocpp16-perf-test.outputs.SUMMARY_16}}
```

### OCPP 2.0.1
```json
${{steps.ocpp201-perf-test.outputs.SUMMARY_201}}
```

pr-number: ${{ github.event.pull_request.number }}
comment-tag: execution

publish_coverage:
runs-on: ubuntu-latest
# Unit and integration tests must be run before publishing coverage
needs: [ unit, integration ]
name: Publish coverage
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6
- name: Download coverage from tests
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: coverage_${{ github.sha }}
- name: Publish
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
certs/

central_system_sim
charge_point_sim
charge_point_sim
example/1.6/results/**
example/2.0.1/results/**
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019
Copyright (c) 2025 xBlaz3kx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
67 changes: 65 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,65 @@
test:
docker compose -f docker-compose.test.yaml up toxiproxy integration_test --abort-on-container-exit
# OCPP_VERSION variable for examples and performance tests (default: 1.6)
# Supported versions: 1.6, 2.0.1
OCPP_VERSION ?= 1.6

# Derive directory path and service name from OCPP_VERSION
OCPP_DIR = example/$(OCPP_VERSION)
OCPP_SERVICE = $(if $(filter 1.6,$(OCPP_VERSION)),central-system,csms)

.PHONY: test example example-observability example-ocpp-201 example-ocpp-16 example-ocpp16-observability perf-tests perf-tests-ci perf-tests-ocpp16 perf-tests-ocpp201 perf-tests-ocpp21 perf-tests-ocpp16-ci perf-tests-ocpp201-ci perf-tests-ocpp21-ci integration-tests unit-tests benchmarks

integration-tests:
docker compose -f docker-compose.test.yaml up toxiproxy integration_test --abort-on-container-exit --exit-code-from integration_test

unit-tests:
docker compose -f docker-compose.test.yaml up unit_test --abort-on-container-exit --exit-code-from unit_test

# Run benchmarks for ocppj, ws, and internal packages
benchmarks:
docker compose -f docker-compose.test.yaml up benchmarks --abort-on-container-exit --exit-code-from benchmarks

# Generic example target
# Usage: make example OCPP_VERSION=2.0.1
example:
docker compose -f $(OCPP_DIR)/docker-compose.yml up --build

# Generic example with observability enabled
# Usage: make example-observability OCPP_VERSION=2.0.1
example-observability:
METRICS_ENABLED=true docker compose -f $(OCPP_DIR)/docker-compose.yml -f example/docker-compose.observability.yaml up --build

# Version-specific targets (for backward compatibility)
example-ocpp-201:
$(MAKE) example OCPP_VERSION=2.0.1

example-ocpp-16:
$(MAKE) example OCPP_VERSION=1.6

example-ocpp16-observability:
$(MAKE) example-observability OCPP_VERSION=1.6

# Generic performance tests target
# Usage: make perf-tests OCPP_VERSION=2.0.1
perf-tests:
docker compose -f $(OCPP_DIR)/docker-compose.yml \
-f $(OCPP_DIR)/docker-compose.k6.yml \
-f example/docker-compose.observability.yaml up --build

# Generic CI performance tests target
# Usage: make perf-tests-ci OCPP_VERSION=2.0.1
perf-tests-ci:
docker compose -f $(OCPP_DIR)/docker-compose.yml \
-f $(OCPP_DIR)/docker-compose.k6-ci.yml up $(OCPP_SERVICE) k6 --build --abort-on-container-exit

# Version-specific targets (for backward compatibility)
perf-tests-ocpp16:
$(MAKE) perf-tests OCPP_VERSION=1.6

perf-tests-ocpp201:
$(MAKE) perf-tests OCPP_VERSION=2.0.1

perf-tests-ocpp16-ci:
$(MAKE) perf-tests-ci OCPP_VERSION=1.6

perf-tests-ocpp201-ci:
$(MAKE) perf-tests-ci OCPP_VERSION=2.0.1
Loading
Loading