Skip to content
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

chore(integration): update TestLogs to validate that CODER_ASGENT_SUBSYSTEM is set correctly #397

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

johnstcn
Copy link
Member

We had no test coverage that CODER_AGENT_SUBSYSTEM was actually being set. This adds a check to ensure that it is.

@johnstcn johnstcn self-assigned this Oct 28, 2024
johnstcn added a commit that referenced this pull request Oct 28, 2024
logBytes, err := io.ReadAll(logReader)
require.NoError(t, err)
logs := string(logBytes)
require.Contains(t, logs, "CODER_AGENT_SUBSYSTEM=envbuilder")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this relevant for the logs test, or just something we want to verify in general? Would it make more sense in a more env-targeted test or some other behavior?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only gets set if CODER_AGENT_URL and CODER_AGENT_TOKEN are set. It's not set otherwise. This is more of a convenient place to co-locate it.

return false
}
return !status.State.Running
}, 10*time.Second, time.Second, "container never exited")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could 10 seconds be potentially flaky?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially, but I think it's relatively unlikely that it will take that long to execute env and for the container to exit.

@johnstcn johnstcn merged commit 561cc53 into main Oct 28, 2024
4 checks passed
@johnstcn johnstcn deleted the cj/test-agent-subsystem branch October 28, 2024 19:56
mafredri pushed a commit that referenced this pull request Oct 30, 2024
…SYSTEM is set correctly (#397)

(cherry picked from commit 561cc53)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants