🧪 test: fix poor BDD step implementations to properly use ErrPending\n\n- Make 6 step functions return godog.ErrPending instead of misleading nil returns\n- theExpiredSecondarySecretShouldBeAutomaticallyRemoved: was only checking time\n- iShouldSeeCleanupEventInLogs: was only checking server status\n- theLogsShouldNotExposeTheFullSecret: was only checking server status\n- iShouldSeeMetricIncrement/Decrease/HistogramUpdate: were only setting flags\n- These functions now honestly reflect their unimplemented status\n- Maintains all legitimate setup functions and proper test implementations\n\nGenerated by Mistral Vibe.\nCo-Authored-By: Mistral Vibe <vibe@mistral.ai>
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Failing after 3m16s

This commit is contained in:
2026-04-10 08:50:45 +02:00
parent 0011bed168
commit 520da07bfe

View File

@@ -111,15 +111,9 @@ func (s *JWTRetentionSteps) iWaitForTheRetentionPeriodToElapse() error {
func (s *JWTRetentionSteps) theExpiredSecondarySecretShouldBeAutomaticallyRemoved() error { func (s *JWTRetentionSteps) theExpiredSecondarySecretShouldBeAutomaticallyRemoved() error {
// Verify the secondary secret is no longer valid // Verify the secondary secret is no longer valid
// Since we can't actually test secret expiration in this mock implementation, // In a real implementation, this would try to use the expired secret
// we'll verify that the retention period has elapsed // and verify it fails. Currently just a placeholder.
if s.elapsedHours == 0 { return godog.ErrPending
return fmt.Errorf("retention period has not elapsed")
}
// In a real implementation, we would try to use the expired secret
// and verify it fails. For now, we'll just verify the time has passed.
return nil
} }
func (s *JWTRetentionSteps) thePrimarySecretShouldRemainActive() error { func (s *JWTRetentionSteps) thePrimarySecretShouldRemainActive() error {
@@ -131,8 +125,7 @@ func (s *JWTRetentionSteps) thePrimarySecretShouldRemainActive() error {
func (s *JWTRetentionSteps) iShouldSeeCleanupEventInLogs() error { func (s *JWTRetentionSteps) iShouldSeeCleanupEventInLogs() error {
// Check logs for cleanup events // Check logs for cleanup events
// In real implementation, this would verify log output // In real implementation, this would verify log output
// For now, we'll just verify server is running return godog.ErrPending
return s.client.Request("GET", "/api/ready", nil)
} }
// Retention Calculation Steps // Retention Calculation Steps
@@ -277,35 +270,20 @@ func (s *JWTRetentionSteps) iHaveEnabledPrometheusMetrics() error {
func (s *JWTRetentionSteps) iShouldSeeMetricIncrement(metric string) error { func (s *JWTRetentionSteps) iShouldSeeMetricIncrement(metric string) error {
// Verify metric was incremented // Verify metric was incremented
if !s.metricsEnabled { // In real implementation, this would check actual metrics
return fmt.Errorf("metrics not enabled") return godog.ErrPending
}
// Store the metric for verification
s.lastMetric = metric
s.metricIncremented = true
return nil
} }
func (s *JWTRetentionSteps) iShouldSeeMetricDecrease(metric string) error { func (s *JWTRetentionSteps) iShouldSeeMetricDecrease(metric string) error {
// Verify metric was decremented // Verify metric was decremented
if !s.metricsEnabled { // In real implementation, this would check actual metrics
return fmt.Errorf("metrics not enabled") return godog.ErrPending
}
// Store the metric for verification
s.lastMetric = metric
s.metricDecremented = true
return nil
} }
func (s *JWTRetentionSteps) iShouldSeeHistogramUpdate(metric string) error { func (s *JWTRetentionSteps) iShouldSeeHistogramUpdate(metric string) error {
// Verify histogram was updated // Verify histogram was updated
if !s.metricsEnabled { // In real implementation, this would check actual histogram metrics
return fmt.Errorf("metrics not enabled") return godog.ErrPending
}
// Store the histogram metric for verification
s.lastHistogramMetric = metric
s.histogramUpdated = true
return nil
} }
// Logging Steps // Logging Steps
@@ -336,8 +314,8 @@ func (s *JWTRetentionSteps) theLogsShouldShowMaskedSecret(masked string) error {
func (s *JWTRetentionSteps) theLogsShouldNotExposeTheFullSecret() error { func (s *JWTRetentionSteps) theLogsShouldNotExposeTheFullSecret() error {
// Verify no full secret exposure // Verify no full secret exposure
// For now, we'll just verify server is running // In real implementation, this would check log output
return s.client.Request("GET", "/api/ready", nil) return godog.ErrPending
} }
// Performance Steps // Performance Steps