Skip to content

Plugin test suite: Automate testing of 'algo test' FSM

A first version of a test suite that verifies the 'algo test' FSM on any board with a single command has been merged into the Serenity plugin repository in p2-xware/software/serenity-herd!31 (merged) (summary of functionality is in p2-xware/software/serenity-herd#3 (closed)).

Next step: Import the test implementation into this repository. This will allow it to be equally easily be used by all board-specific plugins, and streamline the process of running the tests themselves.

Key items:

  • Move test code under src/swatch/test_plugin

  • Create a dedicated docker image for running the test

    • docker/Dockerfile: Add a new target build stage - plugin-algo-fsm-tester - with appropriate entrypoint
    • .gitlab-ci.yml: Add ,plugin-algo-fsm-tester to the end of IMAGE_SUFFIXES and BUILD_TARGETS in .build_images and build:image_manifest so that the CI automatically builds this new docker image
  • Some code cleanup - e.g:

    • The compareBufferWithRef function is deliberately copied from src/swatch/cli/board_data.py - should refactor to avoid that duplication
    • I spotted that both in here and in the FSM runner scripts we run os.makedirs before running the FileResult.save method
      • It would be good to just add that to the FileResult.save method in src/swatch/action.py
Edited by Tom Williams