Skip to content

chore(tests) #81 Add missing tests (99% line coverage) - #88

Merged
njoubert-cleverage merged 1 commit into
mainfrom
81
Oct 2, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
81

Conversation

@njoubert-cleverage

@njoubert-cleverage njoubert-cleverage commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes #81.

These tests found the regression of #84 fixed by #87 (merged).

Coverage: 1062/1070 lines (99.25%), 322 tests (from 2/1103 lines before #86).

Functional tests (tests/Functional), on a test application (tests/App/TestKernel.php): the bundle and its dependencies (EasyAdmin, Doctrine, Security, Twig, Monolog, TwigComponent, process-bundle), a SQLite database recreated for each test, in-memory Messenger transports, a few test processes (direct launch, text / file launch forms, private, failing). Its own temporary directory per PHP process.

  • SecurityTest: every UI page redirects anonymous users to the login page, login (valid / invalid password), logout
  • ProcessListTest: public processes listed (not the private ones), "Users" menu reserved to admins, user locale
  • LaunchActionTest: direct launch (message dispatched with the execution_user), text form with UI defaults and context, file upload (saved in upload_directory), missing / unknown process
  • ProcessExecutionCrudTest, LogRecordCrudTest, ProcessScheduleCrudTest, UserCrudTest: CRUD pages, filters, "show logs" / "download log file" actions, schedule creation / edition / validation, worker warning, users reserved to admins, password confirmation, token generation (only its hash stored)
  • HttpProcessExecuteTest: queued and synchronous executions, failing process, JSON body and context, unknown process (422), invalid / missing token (401), token generated in the UI then used on the API

Unit tests of every other class: DI extension and configuration, bundle, UserCreateCommand, the 6 migrations (SQL per platform), entities and enums, managers, message handlers, CronScheduler, ProcessEventSubscriber, Monolog handlers, repositories (on the test application), HTTP value resolver, forms, EasyAdmin fields and filters, Twig extensions / runtimes, validators, LogoutController.

Each test class declares the classes it covers and every class it runs (CoversClass / UsesClass, beStrictAboutCoverageMetadata): checked with each test file run alone and with the whole suite in random order (no risky test). No UsesNamespace (not available in PHPUnit 11, used by the CI on PHP 8.2).

phpunit.xml.dist: memory_limit set to 512M, the suite peaks at about 125 MB (default limit: 128M); the functional tests run without debug. tests/App/config/reference.php, generated by Symfony when the test application boots, is ignored.

Not covered (8 lines):

  • ProcessConfigurationsManager.php:87-91: unreachable with symfony/options-resolver 8 (bug, see below)
  • ProcessExecutionCrudController.php:147: file_get_contents() emits a warning before returning false on a missing log file (bug, see below)
  • LogLevelExtensionRuntime.php:42,48: match lines inside a ternary, not reported by Xdebug although every arm is executed

src/ is unchanged: the issues found while writing these tests will be handled in dedicated issues.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None (tests only).

🤖 Generated with Claude Code

…e HTTP API, unit tests of every class

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit c0bb648 into main Oct 2, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing tests

1 participant