Skip to content
Merged
Show file tree
Hide file tree
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
30 changes: 30 additions & 0 deletions pkgs/mcpx/internal/e2e/effect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ var implementedEffectProbes = map[string]string{
"protoTasks.maxPerRequestor": "TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment",
"protoTasks.perMinute": "TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment",
"events.history": "TestEventsHistoryBoundsTheReplay",
"logging.maxAge": "TestLoggingMaxAgeRotatesAnAgedFile",
"logstore.followBacklog": "TestFollowBacklogCapsWhatOneFollowPollEmits",
"paths.config": "TestPathsConfigReadsAConfigOnlyThatPathHolds",
"script.imports": "TestScriptImportsOffSkipsTheImportPipeline",
Expand Down Expand Up @@ -317,6 +318,7 @@ var effectProbeFuncs = map[string]func(*testing.T){
"TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment": TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment,
"TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment": TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment,
"TestEventsHistoryBoundsTheReplay": TestEventsHistoryBoundsTheReplay,
"TestLoggingMaxAgeRotatesAnAgedFile": TestLoggingMaxAgeRotatesAnAgedFile,
"TestFollowBacklogCapsWhatOneFollowPollEmits": TestFollowBacklogCapsWhatOneFollowPollEmits,
"TestPathsConfigReadsAConfigOnlyThatPathHolds": TestPathsConfigReadsAConfigOnlyThatPathHolds,
"TestScriptImportsOffSkipsTheImportPipeline": TestScriptImportsOffSkipsTheImportPipeline,
Expand Down Expand Up @@ -4598,6 +4600,34 @@ func TestPathsConfigReadsAConfigOnlyThatPathHolds(t *testing.T) {
}
}

// TestLoggingMaxAgeRotatesAnAgedFile is the effect probe for
// logging.maxAge. Today's log file already holds a record from two hours
// ago. Oracle: at the default 24h the next run appends to it and keeps one
// file; at maxAge=1h the first new record rotates the aged file aside.
func TestLoggingMaxAgeRotatesAnAgedFile(t *testing.T) {
files := func(env ...string) []string {
t.Helper()
e := newEnv(t, oneServer)
dir := filepath.Join(t.TempDir(), "logs")
if err := os.MkdirAll(dir, 0o700); err != nil {
t.Fatal(err)
}
now := time.Now()
aged := fmt.Sprintf(`{"ts":%q,"level":"info","msg":"aged","event":"harness.aged"}`+"\n",
now.Add(-2*time.Hour).Format(time.RFC3339Nano))
mustWrite(t, filepath.Join(dir, "mcpx-"+now.Format("2006-01-02")+".jsonl"), aged)
e.setenv(append([]string{"MCPX_LOGGING_DIR=" + dir}, env...)...)
e.run("ls")
return logFiles(t, dir)
}
if got := files(); len(got) != 1 {
t.Errorf("at the default logging.maxAge a two-hour-old file should keep taking records: %v", got)
}
if got := files("MCPX_LOGGING_MAX_AGE=1h"); len(got) < 2 {
t.Errorf("logging.maxAge=1h should rotate the two-hour-old file aside: %v", got)
}
}

// TestDaemonAddressIsReachableFromTheEnvironment is the effect probe
// for daemon.address (#8468 chain 1). The exemption it replaced said
// a bind address is a network identity the harness cannot vary
Expand Down
1 change: 0 additions & 1 deletion pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ setting plugin.instructions no integration-test exercise yet; burn-down #8472 (s
setting plugin.remember no integration-test exercise yet; burn-down #8472 (settings plugin family); needs an EffectProbes entry + e2e test
setting plugin.toolTiming no integration-test exercise yet; burn-down #8472 (settings plugin family); needs an EffectProbes entry + e2e test
setting plugin.tools no integration-test exercise yet; burn-down #8472 (settings plugin family); needs an EffectProbes entry + e2e test
setting logging.maxAge no integration-test exercise yet; burn-down #8467 (settings core-paths family); needs an EffectProbes entry + e2e test
setting output.color no integration-test exercise yet; burn-down #8467 (settings core-paths family); needs an EffectProbes entry + e2e test
setting embeddings.wasmPath no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
setting deps.autoInstall no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
Expand Down
Loading