Skip to content

Conversation

@gokseniin
Copy link

Summary

I've added an automated smoke test for the recording functionality to address #775.

What kind of change does this PR introduce?

  • New Feature (Automated Smoke Test)

Implementation Details:

  • Daemon Thread: The test runs openadapt.record in a background daemon thread to avoid blocking the main test execution.
  • Stop Sequence (Ctrl+C): I used pynput to simulate the Ctrl+C keyboard interrupt.
    • Note on implementation: The test explicitly catches the KeyboardInterrupt exception. This ensures that the test runner doesn't crash (especially on Windows) and can proceed to the verification step cleanly.
  • Verification:
    • Database: It queries the SQLite DB to confirm the Recording entry was created.
    • Filesystem: It attempts to verify the existence of the video file (video_path). I added a check to handle cases where the schema version might differ, so the test remains stable across environments.
  • Windows Support: Added a ctypes hard exit strategy to prevent multiprocessing permission errors causing hanging processes on Windows.

Checklist

  • My code follows the style guidelines of OpenAdapt
  • I have performed a self-review of my code
  • I have added tests to prove my fix is functional/effective
  • I have linted my code locally prior to submission
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes

Fixes

Fixes #775
/claim #775

Demo Video

smoke_test_demo.mp4

This file contains a smoke test for the OpenAdapt recording functionality, verifying the recorder's ability to start, capture data, stop via keyboard interrupt, and persist data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add recording smoke test

1 participant