0
0
Fork 0
Codesys-MCP-SP21-plus/tests/integration
Karstein Phobic Nyvold Kvistad b013c4ee53 fix: code-review findings -- dot-path name check, Python string-literal injection
1. find_object_by_path: final name verification used the original
   full_path instead of the dot->slash normalized segments, so
   dot-separated paths ('Application.MyPOU') traversed correctly but
   failed the final check and returned None.
2. User-arbitrary values (plcPath/plcDirectory, passwords, comments,
   project-info fields, device parameter name/value, task event,
   device credentials) were interpolated into r"..."/r"""...""" Python
   literals unescaped -- a quote or triple-quote in the value broke the
   generated script (or injected code). Templates now take pre-escaped
   literals via pyStringLiteral().

Reviewed-range: dead49a..e9aa714. Third reviewer finding (task.priority
must be int) was rejected: SP21 ScriptTaskConfigObject.pyi types the
priority/interval/interval_unit setters as str.
2026-06-12 14:02:22 +02:00
..
build-object-tools-prep.test.ts feat: add 5 application-build & object tools (SP21 coverage, phase 3) 2026-06-12 13:07:06 +02:00
device-task-tools-prep.test.ts fix: code-review findings -- dot-path name check, Python string-literal injection 2026-06-12 14:02:22 +02:00
e2e.test.ts test(e2e): regression coverage for the four 2026-04-29 fixes (#14) 2026-04-29 13:44:02 +02:00
online-tools-prep.test.ts fix: code-review findings -- dot-path name check, Python string-literal injection 2026-06-12 14:02:22 +02:00
project-tools-prep.test.ts fix: code-review findings -- dot-path name check, Python string-literal injection 2026-06-12 14:02:22 +02:00
README.md Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
users-misc-tools-prep.test.ts fix: code-review findings -- dot-path name check, Python string-literal injection 2026-06-12 14:02:22 +02:00

Manual CODESYS Integration Tests

These tests require a real CODESYS installation and cannot run in CI.

Prerequisites

  • CODESYS 3.5 SP19 or SP21 installed
  • No other CODESYS instances running
  • Node.js 18+

Steps

1. Build the package

npm run build

2. Test persistent mode

node dist/bin.js \
  --codesys-path "C:\path\to\CODESYS.exe" \
  --codesys-profile "CODESYS V3.5 SP21 Patch 3" \
  --mode persistent \
  --verbose

Verify:

  • CODESYS UI opens
  • Console shows "CODESYS watcher is ready"
  • The MCP server accepts connections

3. Test headless fallback

node dist/bin.js \
  --codesys-path "C:\path\to\CODESYS.exe" \
  --codesys-profile "CODESYS V3.5 SP21 Patch 3" \
  --mode headless

4. Test --detect flag

node dist/bin.js --detect

Verify: Lists installed CODESYS versions.

5. Ctrl+C shutdown

  • Press Ctrl+C during persistent mode
  • Verify CODESYS shuts down cleanly