From 619601c078e150be7d6d5a5f949aefba619ec6e1 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Wed, 25 Jun 2025 11:07:40 +0000 Subject: [PATCH] test(agent/agentcontainers): add is a test ignore label to integration tests --- agent/agent_test.go | 7 +++++-- agent/agentcontainers/devcontainercli_test.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/agent/agent_test.go b/agent/agent_test.go index 1b24520e45cc5..364ccb0e1abc4 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -2130,7 +2130,7 @@ func TestAgent_DevcontainerAutostart(t *testing.T) { "name": "mywork", "image": "ubuntu:latest", "cmd": ["sleep", "infinity"], - "runArgs": ["--network=host"] + "runArgs": ["--network=host", "--label=`+agentcontainers.DevcontainerIsTestRunLabel+`=true"] }`), 0o600) require.NoError(t, err, "write devcontainer.json") @@ -2167,6 +2167,7 @@ func TestAgent_DevcontainerAutostart(t *testing.T) { // Only match this specific dev container. agentcontainers.WithClock(mClock), agentcontainers.WithContainerLabelIncludeFilter("devcontainer.local_folder", tempWorkspaceFolder), + agentcontainers.WithContainerLabelIncludeFilter(agentcontainers.DevcontainerIsTestRunLabel, "true"), agentcontainers.WithSubAgentURL(srv.URL), // The agent will copy "itself", but in the case of this test, the // agent is actually this test binary. So we'll tell the test binary @@ -2288,7 +2289,8 @@ func TestAgent_DevcontainerRecreate(t *testing.T) { err = os.WriteFile(devcontainerFile, []byte(`{ "name": "mywork", "image": "busybox:latest", - "cmd": ["sleep", "infinity"] + "cmd": ["sleep", "infinity"], + "runArgs": ["--label=`+agentcontainers.DevcontainerIsTestRunLabel+`=true"] }`), 0o600) require.NoError(t, err, "write devcontainer.json") @@ -2315,6 +2317,7 @@ func TestAgent_DevcontainerRecreate(t *testing.T) { o.Devcontainers = true o.DevcontainerAPIOptions = append(o.DevcontainerAPIOptions, agentcontainers.WithContainerLabelIncludeFilter("devcontainer.local_folder", workspaceFolder), + agentcontainers.WithContainerLabelIncludeFilter(agentcontainers.DevcontainerIsTestRunLabel, "true"), ) }) diff --git a/agent/agentcontainers/devcontainercli_test.go b/agent/agentcontainers/devcontainercli_test.go index fe64b04abb884..ed600c6d1ee49 100644 --- a/agent/agentcontainers/devcontainercli_test.go +++ b/agent/agentcontainers/devcontainercli_test.go @@ -586,7 +586,7 @@ func setupDevcontainerWorkspace(t *testing.T, workspaceFolder string) string { "containerEnv": { "TEST_CONTAINER": "true" }, - "runArgs": ["--label", "com.coder.test=devcontainercli"] + "runArgs": ["--label=com.coder.test=devcontainercli", "--label=` + agentcontainers.DevcontainerIsTestRunLabel + `=true"] }` err = os.WriteFile(configPath, []byte(content), 0o600) require.NoError(t, err, "create devcontainer.json file") pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy