FilterPerTestAndLaxPromotedTierAware is the tier-aware variant of FilterPerTestAndLaxPromoted. It accepts firstWindowStart (the earliest test window start observed by the agent's MockManager, or zero before any real test has fired) so the strict gate can preserve per-test startup-init mocks (req < f
(ctx context.Context, logger *zap.Logger, m []*models.Mock, afterTime time.Time, beforeTime time.Time, strict bool, firstWindowStart time.Time)
| 2931 | // test). Legacy callers that don't know firstWindowStart can keep |
| 2932 | // calling FilterPerTestAndLaxPromoted unchanged. |
| 2933 | func FilterPerTestAndLaxPromotedTierAware(ctx context.Context, logger *zap.Logger, m []*models.Mock, afterTime time.Time, beforeTime time.Time, strict bool, firstWindowStart time.Time) ([]*models.Mock, []*models.Mock) { |
| 2934 | perTestInWindow, promotedToSession := filterByTimeStampTierAware(ctx, logger, m, afterTime, beforeTime, strict, firstWindowStart) |
| 2935 | |
| 2936 | sort.SliceStable(perTestInWindow, func(i, j int) bool { |
| 2937 | return perTestInWindow[i].Spec.ReqTimestampMock.Before(perTestInWindow[j].Spec.ReqTimestampMock) |
| 2938 | }) |
| 2939 | sort.SliceStable(promotedToSession, func(i, j int) bool { |
| 2940 | return promotedToSession[i].Spec.ReqTimestampMock.Before(promotedToSession[j].Spec.ReqTimestampMock) |
| 2941 | }) |
| 2942 | |
| 2943 | return perTestInWindow, promotedToSession |
| 2944 | } |
| 2945 | |
| 2946 | // FilterConfigMocks applies the per-test time-window filter to the config |
| 2947 | // mock pool. Pass strict=true for Option-1 containment (out-of-window |
no test coverage detected