Several tests write files into testOutput without creating that directory first. They pass only when some other test has already created it, so whether they pass depends on test order. This surfaced when the 2.x build first ran on GitHub Actions, where Issue88Test ran early and failed:
java.nio.file.NoSuchFileException: testOutput/Issue88.kdbx
Affected:
- 2.x:
Issue87Test, Issue88Test and SimpleQuickStartTest in example. QuickStart.ensureOutputDir() existed but was never called, and PropertyValueChecks and SaveAndReloadChecks each had their own copy.
- 3.x:
Issue87Test, Issue88Test, KdbxFileSaveAndReloadTest and ProtectedPropertyTest2.
Fix
Add one shared helper to TestUtil (in util for 2.x, test for 3.x) that returns a path in testOutput and creates the directory, and use it in every test that writes output, replacing the separate copies. Check each affected test passes when run on its own with no testOutput directory.
Several tests write files into
testOutputwithout creating that directory first. They pass only when some other test has already created it, so whether they pass depends on test order. This surfaced when the 2.x build first ran on GitHub Actions, whereIssue88Testran early and failed:Affected:
Issue87Test,Issue88TestandSimpleQuickStartTestinexample.QuickStart.ensureOutputDir()existed but was never called, andPropertyValueChecksandSaveAndReloadCheckseach had their own copy.Issue87Test,Issue88Test,KdbxFileSaveAndReloadTestandProtectedPropertyTest2.Fix
Add one shared helper to
TestUtil(inutilfor 2.x,testfor 3.x) that returns a path intestOutputand creates the directory, and use it in every test that writes output, replacing the separate copies. Check each affected test passes when run on its own with notestOutputdirectory.