@@ -76,9 +76,25 @@ describe('Article', () => {
76
76
) ;
77
77
cy . log ( ' Check that all files exist and are readable' ) ;
78
78
79
- Cypress . fail (
80
- `Incremental validation task failed: ${ error . message } . Check logs for details.`
79
+ // Instead of failing completely, fall back to testing all provided subjects
80
+ cy . log (
81
+ '🔄 Falling back to test all provided subjects without cache optimization'
81
82
) ;
83
+
84
+ // Reset validation strategy to indicate fallback mode
85
+ validationStrategy = {
86
+ fallback : true ,
87
+ error : error . message ,
88
+ unchanged : [ ] ,
89
+ changed : sourceFilePaths . map ( ( filePath ) => ( {
90
+ filePath,
91
+ error : 'fallback' ,
92
+ } ) ) ,
93
+ total : sourceFilePaths . length ,
94
+ } ;
95
+
96
+ // Keep original subjects for testing (should come from test_subjects env var)
97
+ cy . log ( `📋 Testing ${ subjects . length } pages in fallback mode` ) ;
82
98
} ) ;
83
99
} ) ;
84
100
@@ -194,20 +210,34 @@ describe('Article', () => {
194
210
cy . log ( ` • Test subjects count: ${ subjects . length } ` ) ;
195
211
cy . log ( ` • Validation strategy: ${ validationStrategy || 'Not set' } ` ) ;
196
212
197
- if ( subjects . length === 0 ) {
198
- cy . log ( '⚠️ No test subjects found - this may indicate:' ) ;
213
+ // Check if we're in fallback mode due to cache system issues
214
+ if ( validationStrategy && validationStrategy . fallback ) {
215
+ cy . log ( '⚠️ Running in fallback mode due to cache system error' ) ;
216
+ cy . log ( ` • Error: ${ validationStrategy . error } ` ) ;
217
+ cy . log ( ' • All files will be tested without cache optimization' ) ;
218
+
219
+ // Ensure we have subjects to test in fallback mode
220
+ expect ( subjects . length ) . to . be . greaterThan (
221
+ 0 ,
222
+ 'Should have test subjects in fallback mode'
223
+ ) ;
224
+ } else if ( subjects . length === 0 ) {
225
+ cy . log ( '⚠️ No test subjects found - analyzing cause:' ) ;
199
226
cy . log ( ' • All files were cached and skipped' ) ;
200
227
cy . log ( ' • No files matched the test criteria' ) ;
201
228
cy . log ( ' • File mapping failed during setup' ) ;
202
229
203
230
// Don't fail if this is expected (cache hit scenario)
204
231
const testSubjectsData = Cypress . env ( 'test_subjects_data' ) ;
205
232
if ( testSubjectsData ) {
206
- cy . log (
207
- 'ℹ️ Test subjects data is available, cache optimization likely active'
208
- ) ;
233
+ cy . log ( '✅ Cache optimization active - this is expected' ) ;
234
+ cy . log ( 'ℹ️ Test subjects data is available, all files cached' ) ;
209
235
} else {
210
236
cy . log ( '❌ No test subjects data available - potential setup issue' ) ;
237
+ // Only fail if we have no data and no subjects - indicates a real problem
238
+ expect ( testSubjectsData ) . to . not . be . empty (
239
+ 'Should have test subjects data when no subjects to test'
240
+ ) ;
211
241
}
212
242
} else {
213
243
cy . log ( `✅ Ready to test ${ subjects . length } pages` ) ;
@@ -216,6 +246,9 @@ describe('Article', () => {
216
246
cy . log ( ` ... and ${ subjects . length - 5 } more pages` ) ;
217
247
}
218
248
}
249
+
250
+ // Always pass if we get to this point - the setup is valid
251
+ cy . log ( '✅ Test setup validation completed successfully' ) ;
219
252
} ) ;
220
253
221
254
subjects . forEach ( ( subject ) => {
0 commit comments