Skip to content

chore: Invert delay_login_until_ready, now login_before_ready #5893

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

Prev Previous commit
Next Next commit
Add lifecycle states to tests
  • Loading branch information
mafredri committed Jan 27, 2023
commit ebf8a0d13071759a57595d819334d07b57189e67
4 changes: 4 additions & 0 deletions cli/cliui/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestWorkspaceResources(t *testing.T) {
Agents: []codersdk.WorkspaceAgent{{
Name: "dev",
Status: codersdk.WorkspaceAgentConnected,
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
Architecture: "amd64",
OperatingSystem: "linux",
}},
Expand Down Expand Up @@ -60,6 +61,7 @@ func TestWorkspaceResources(t *testing.T) {
Agents: []codersdk.WorkspaceAgent{{
CreatedAt: database.Now().Add(-10 * time.Second),
Status: codersdk.WorkspaceAgentConnecting,
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
Name: "dev",
OperatingSystem: "linux",
Architecture: "amd64",
Expand All @@ -70,12 +72,14 @@ func TestWorkspaceResources(t *testing.T) {
Name: "dev",
Agents: []codersdk.WorkspaceAgent{{
Status: codersdk.WorkspaceAgentConnected,
LifecycleState: codersdk.WorkspaceAgentLifecycleReady,
Name: "go",
Architecture: "amd64",
OperatingSystem: "linux",
}, {
DisconnectedAt: &disconnected,
Status: codersdk.WorkspaceAgentDisconnected,
LifecycleState: codersdk.WorkspaceAgentLifecycleReady,
Name: "postgres",
Architecture: "amd64",
OperatingSystem: "linux",
Expand Down
6 changes: 5 additions & 1 deletion cmd/cliui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ func main() {
Use: "agent",
RunE: func(cmd *cobra.Command, args []string) error {
agent := codersdk.WorkspaceAgent{
Status: codersdk.WorkspaceAgentDisconnected,
Status: codersdk.WorkspaceAgentDisconnected,
LifecycleState: codersdk.WorkspaceAgentLifecycleReady,
}
go func() {
time.Sleep(3 * time.Second)
Expand Down Expand Up @@ -203,6 +204,7 @@ func main() {
Agents: []codersdk.WorkspaceAgent{{
CreatedAt: database.Now().Add(-10 * time.Second),
Status: codersdk.WorkspaceAgentConnecting,
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
Name: "dev",
OperatingSystem: "linux",
Architecture: "amd64",
Expand All @@ -213,12 +215,14 @@ func main() {
Name: "dev",
Agents: []codersdk.WorkspaceAgent{{
Status: codersdk.WorkspaceAgentConnected,
LifecycleState: codersdk.WorkspaceAgentLifecycleReady,
Name: "go",
Architecture: "amd64",
OperatingSystem: "linux",
}, {
DisconnectedAt: &disconnected,
Status: codersdk.WorkspaceAgentDisconnected,
LifecycleState: codersdk.WorkspaceAgentLifecycleReady,
Name: "postgres",
Architecture: "amd64",
OperatingSystem: "linux",
Expand Down