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