Skip to content

fix: skip TestReinitializeAgent until we can adapt it for windows #17968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2025
Merged
Changes from 1 commit
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
Next Next commit
make TestReinitializeAgent work on Windows
  • Loading branch information
SasSwart committed May 21, 2025
commit f93e987153d0a0a32e8432168c33d6a401bb43a8
10 changes: 9 additions & 1 deletion enterprise/coderd/workspaceagents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"os"
"regexp"
"runtime"
"testing"
"time"

Expand Down Expand Up @@ -89,6 +90,13 @@ func TestReinitializeAgent(t *testing.T) {
t.Skip("dbmem cannot currently claim a workspace")
}

var startupScript string
if runtime.GOOS == "windows" {
startupScript = fmt.Sprintf("cmd.exe /c set >> \"%s\" && echo --- >> \"%s\"", tempAgentLog.Name(), tempAgentLog.Name())
} else {
startupScript = fmt.Sprintf("printenv >> %s; echo '---\n' >> %s", tempAgentLog.Name(), tempAgentLog.Name())
}

db, ps := dbtestutil.NewDB(t)
// GIVEN a live enterprise API with the prebuilds feature enabled
client, user := coderdenttest.New(t, &coderdenttest.Options{
Expand Down Expand Up @@ -155,7 +163,7 @@ func TestReinitializeAgent(t *testing.T) {
Scripts: []*proto.Script{
{
RunOnStart: true,
Script: fmt.Sprintf("printenv >> %s; echo '---\n' >> %s", tempAgentLog.Name(), tempAgentLog.Name()), // Make reinitialization take long enough to assert that it happened
Script: startupScript,
},
},
Auth: &proto.Agent_Token{
Expand Down