Skip to content

Commit 6877db0

Browse files
Merge branch 'master' into jeremypoulter/core_partition
2 parents 2fb1253 + 98e2273 commit 6877db0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+373
-6823
lines changed

.github/workflows/build.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
run: echo "github.ref_name = '${{ github.ref_name }}'"
3939

4040
build:
41+
name: Build ${{ matrix.env }} with ${{ matrix.gui.name }}
4142
runs-on: ubuntu-latest
4243

4344
strategy:
@@ -133,6 +134,7 @@ jobs:
133134
path: .pio/build/${{ matrix.env }}/firmware.bin
134135

135136
release:
137+
name: Upload release assets
136138
runs-on: ubuntu-latest
137139
needs: build
138140
if: github.ref_name == 'master' || startsWith(github.ref_name, 'v')

.github/workflows/divert_sim.yaml

+25-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
name: Build OpenEVSE divert simulator
44

5+
# Allow dependabot to update checks
56
permissions:
7+
checks: write
8+
actions: write
69
contents: write
10+
issues: read
11+
pull-requests: write
712

813
on:
914
push:
@@ -13,6 +18,7 @@ on:
1318

1419
jobs:
1520
build:
21+
name: Build and test divert_sim
1622
runs-on: ubuntu-latest
1723

1824
steps:
@@ -73,11 +79,21 @@ jobs:
7379
with:
7480
name: divert_sim
7581
path: OpenEVSE_WiFi/divert_sim/divert_sim
76-
82+
83+
- name: Set up Python 3.10
84+
uses: actions/setup-python@v4
85+
with:
86+
python-version: '3.10'
87+
cache: 'pip' # caching pip dependencies
88+
89+
- name: Install dependencies
90+
run: pip install -r OpenEVSE_WiFi/divert_sim/requirements.txt
91+
7792
- name: run tests
7893
run: |
7994
cd OpenEVSE_WiFi/divert_sim
80-
bash runall.sh
95+
mkdir -p output
96+
pytest -v --color=yes --code-highlight yes --junit-xml=output/test_results.xml
8197
8298
- name : Upload test results
8399
uses: actions/upload-artifact@v3
@@ -86,3 +102,10 @@ jobs:
86102
path: |
87103
OpenEVSE_WiFi/divert_sim/output
88104
OpenEVSE_WiFi/divert_sim/view.html
105+
106+
- name: Publish Unit Test Results
107+
uses: EnricoMi/publish-unit-test-result-action/composite@v2
108+
if: always()
109+
with:
110+
junit_files: OpenEVSE_WiFi/divert_sim/output/*.xml
111+
check_name: Test Results

api.yml

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ paths:
5454
rapi_connected: 1
5555
amp: 0
5656
pilot: 32
57+
max_current: 32
5758
temp1: 282
5859
temp2: -2560
5960
temp3: -2560

divert_sim/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ ARDUINO_OBJ := \
8787
Stream.o \
8888
Wire.o \
8989
WMath.o \
90-
WString.o
90+
WString.o \
91+
Injection.o
9192

9293
EPOXY_FS_OBJ := \
9394
EpoxyFS.o \
@@ -116,6 +117,8 @@ VPATH := \
116117
. \
117118
../src \
118119
$(EPOXY_CORE_PATH) \
120+
$(EPOXY_CORE_PATH)/epoxy_test/Injection \
121+
$(EPOXY_CORE_PATH)/epoxy_test/Script \
119122
$(ARDUINO_LIB_DIR)/OpenEVSE_Lib/src \
120123
$(ARDUINO_LIB_DIR)/MicroTasks/src \
121124
$(ARDUINO_LIB_DIR)/ConfigJson/src \

divert_sim/divert_sim.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <MicroTasks.h>
1717
#include <EpoxyFS.h>
1818

19+
#include <epoxy_test/ArduinoTest.h>
20+
1921
using namespace aria::csv;
2022

2123
EventLog eventLog;
@@ -35,6 +37,7 @@ int solar_col = 1;
3537
int voltage_col = 1;
3638

3739
time_t simulated_time = 0;
40+
time_t last_time = 0;
3841

3942
bool kw = false;
4043

@@ -192,6 +195,15 @@ int main(int argc, char** argv)
192195
col++;
193196
}
194197

198+
if(last_time != 0)
199+
{
200+
int delta = simulated_time - last_time;
201+
if(delta > 0) {
202+
EpoxyTest::add_millis(delta * 1000);
203+
}
204+
}
205+
last_time = simulated_time;
206+
195207
divert.update_state();
196208
MicroTask.update();
197209

divert_sim/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest

divert_sim/runall.sh

-37
This file was deleted.

0 commit comments

Comments
 (0)