Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions internal/testrunner/runners/system/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,8 @@ func (r *tester) prepareScenario(ctx context.Context, config *testConfig, stackC
return hits.size() > 0, nil
}, 1*time.Second, waitForDataTimeout)

// before checking "waitErr" error , it is necessary to check if the service has finished with error
// to report it as a test case failed
if service != nil && config.Service != "" && !config.IgnoreServiceError {
exited, code, err := service.ExitCode(ctx, config.Service)
if err != nil && !errors.Is(err, servicedeployer.ErrNotSupported) {
Expand Down Expand Up @@ -1637,16 +1639,6 @@ func (r *tester) validateTestScenario(ctx context.Context, result *testrunner.Re
})
}

stackVersion, err := semver.NewVersion(r.stackVersion.Number)
if err != nil {
return result.WithErrorf("failed to parse stack version: %w", err)
}

err = validateIgnoredFields(stackVersion, scenario, config)
if err != nil {
return result.WithError(err)
}

if r.fieldValidationMethod == mappingsMethod {
logger.Warn("Validation based on mappings enabled (technical preview)")
exceptionFields := listExceptionFields(scenario.docs, fieldsValidator)
Expand All @@ -1669,6 +1661,16 @@ func (r *tester) validateTestScenario(ctx context.Context, result *testrunner.Re
}
}

stackVersion, err := semver.NewVersion(r.stackVersion.Number)
if err != nil {
return result.WithErrorf("failed to parse stack version: %w", err)
}

err = validateIgnoredFields(stackVersion, scenario, config)
if err != nil {
return result.WithError(err)
}

docs := scenario.docs
if scenario.syntheticEnabled {
docs, err = fieldsValidator.SanitizeSyntheticSourceDocs(scenario.docs)
Expand Down