Skip to content

Commit ae8d438

Browse files
authored
Merge pull request #69 from Xento/improvements
New Features Add an MQTT log replay test harness (including fixtures and expected JSON snapshots) to validate parsing and tray detection deterministically. Enhance 3MF handling to better support real-world project file variants used by the replay tests (e.g., G-code-in-3MF and multi-color cases). Add layer tracking for local prints, enabling per-layer / incremental usage tracking in scenarios where only local print data is available. Extend print history with layer and print progress details, and include the original slicer color for better traceability. Recognize failed prints in the processing pipeline so history and downstream logic can reflect FAILED outcomes reliably. ##️ Improvements Flush console output directly to improve log timeliness in containerized/runtime environments. Improve boolean config handling for more robust environment/config parsing. Update CI to Python 3.13 and run tests with layer tracking both disabled and enabled (matrix), improving coverage for both modes. Add a VS Code launch configuration to debug MQTT replay tests more efficiently. Parse booleans correctly when reading config Removed output of spoolman responses Bug Fixes Fix G-code filament-change detection. Fix the start behavior of layer tracking when a local print begins. Fix and adjust tests to keep the new replay suite stable in CI.
2 parents 8a250bf + e84c90f commit ae8d438

34 files changed

Lines changed: 10858 additions & 966 deletions

.github/workflows/python-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
python-version:
77
required: false
88
type: string
9-
default: "3.10"
9+
default: "3.13"
1010
ref:
1111
required: false
1212
type: string

.github/workflows/release-docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
name: Lint Python project
2828
uses: ./.github/workflows/python-lint.yml
2929
with:
30-
python-version: "3.10"
30+
python-version: "3.13"
3131
# Use the same ref as the image build:
3232
# - release: use the release tag
3333
# - workflow_dispatch with tag: use that tag

.github/workflows/tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@ on:
66

77
jobs:
88
python:
9+
name: Python tests (layer-tracking=${{ matrix.layer_tracking }})
910
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
layer_tracking: [false, true]
14+
env:
15+
TRACK_LAYER_USAGE: ${{ matrix.layer_tracking }}
16+
OPENSPOOLMAN_TEST_DATA: "1"
1017
steps:
1118
- name: Checkout
1219
uses: actions/checkout@v4
1320
- name: Set up Python
1421
uses: actions/setup-python@v5
1522
with:
16-
python-version: "3.11"
23+
python-version: "3.13"
1724
- name: Install dependencies
1825
run: |
1926
python -m pip install --upgrade pip

.vscode/launch.json

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,43 @@
2121
],
2222
"jinja": true,
2323
"autoStartBrowser": false
24+
},
25+
{
26+
"name": "Debug MQTT Replay",
27+
"type": "python",
28+
"request": "launch",
29+
"module": "pytest",
30+
"console": "integratedTerminal",
31+
"env": {
32+
"MQTT_LOG_PRINTER": "${input:printerName}",
33+
"MQTT_LOG_FIRMWARE": "${input:firmwareVersion}",
34+
"MQTT_LOG_FILE": "${input:mqttLogFile}"
35+
},
36+
"args": [
37+
"${workspaceFolder}/tests/test_mqtt_replay.py",
38+
"--maxfail=1",
39+
"--capture=no"
40+
]
41+
}
42+
],
43+
"inputs": [
44+
{
45+
"id": "printerName",
46+
"type": "promptString",
47+
"description": "Printer directory under tests/MQTT (e.g. A1) or empty for all",
48+
"default": "A1"
49+
},
50+
{
51+
"id": "firmwareVersion",
52+
"type": "promptString",
53+
"description": "Firmware folder (e.g. 01.07.00.00)",
54+
"default": "01.07.00.00"
55+
},
56+
{
57+
"id": "mqttLogFile",
58+
"type": "promptString",
59+
"description": "Log file (relative to MQTT/, e.g. A1/01.07.00.00/Testqube_local.log)",
60+
"default": "A1/01.07.00.00/Testqube_local.log"
2461
}
2562
]
26-
}
63+
}

0 commit comments

Comments
 (0)