Review main Merged

79392[BUGFIX] Avoid dirty `SilentConfigurationUpgradeServiceTest` test setup

Stefan Bürk CR +2 V +2 Easy +15 −1 updated 06/15/23, 07:12

Commit message

With #100407 the `SilentConfigurationUpgradeServiceTest` has been
promoted from a unit test to a functional test to avoid a mocking
party.

Tests in this test cases write "test configuration" to the test
instances `LocalConfiguration.php` file. For this the update method
`ConfigurationManager->updateLocalConfiguration` is used to set
the test configuration upon the generated test-instance config.

Secondly, the `SilentConfigurationUpgradeService` is used to check
for changed configurations. This service also updates the config,
even if not reloading it. Reload would be done for the next test.

These two facts together leads to dirty LocalConfiguration.php for a
test. Deterministic setup per test is not guaranteed, because the
configuration is not properly cleaned up after a test.

This change stores the functional test instances configuration
in `setUp()` and restores it in `tearDown()`, using the
write method `ConfigurationManager->writeLocalConfiguration()`.
This resets `LocalConfiguration.php` to the state which has
been created by the testing-framework.

The correct expectation, that no change happened, is set for
`versionNumberInFilenameSetToTrueStaysUntouched`.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 1