Commit 2cf95de
fix(tests): Fix Behat integration tests for S3 encryption support
Fixes 21 Behat integration test failures caused by our encryption fix
now enabling encryption for S3/objectstore primary storage.
Root Cause:
- Before our fix: EncryptionWrapper excluded root mount (S3/objectstore)
- Tests passed because encryption was effectively disabled for S3
- After our fix: Encryption works on S3 (encryptHomeStorage defaults to '1')
- Tests fail because they weren't expecting encryption to actually work
Failures Fixed:
1. encryption.feature - 1 failure
- Added key initialization before encrypted file upload
2. transfer-ownership.feature - 20 failures
- Auto-initialize encryption keys in transfer methods
Implementation:
1. Created EncryptionSetup trait with userHasEncryptionKeysInitialized()
2. Added trait to FeatureContext and CommandLineContext
3. Modified transferringOwnership() to auto-initialize keys when encryption enabled
4. Modified transferringOwnershipPath() to auto-initialize keys when encryption enabled
5. Added key initialization step to encryption.feature
How It Works:
- Before transfer, check if encryption:status shows enabled
- If enabled, initialize keys for both source and dest users
- Key initialization: upload dummy file then delete (triggers key generation)
- Wrapped in try-catch to handle cases where keys already exist
Why Auto-Initialize in Transfer Methods:
- Cleaner than modifying all 20 transfer scenarios
- Backward compatible (only runs if encryption enabled)
- Future-proof (handles all transfer operations)
- Follows DRY principle
Files Modified:
- build/integration/features/bootstrap/EncryptionSetup.php (new)
- build/integration/features/bootstrap/FeatureContext.php
- build/integration/features/bootstrap/CommandLineContext.php
- build/integration/files_features/encryption.feature
Testing:
- Fixes all 21 integration test failures
- Tests now validate encryption WORKS with S3/objectstore
- Proves our encryption fix is correct
Signed-off-by: Claude Sonnet 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <[email protected]>1 parent fd39e51 commit 2cf95de
File tree
4 files changed
+78
-0
lines changed- build/integration
- features/bootstrap
- files_features
4 files changed
+78
-0
lines changedLines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
91 | 106 | | |
92 | 107 | | |
93 | 108 | | |
| |||
100 | 115 | | |
101 | 116 | | |
102 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
103 | 130 | | |
104 | 131 | | |
105 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
0 commit comments