Skip to content

Commit 4c17a8b

Browse files
committed
Fix SQL tests
1 parent c4d3cb8 commit 4c17a8b

File tree

2 files changed

+62
-23
lines changed

2 files changed

+62
-23
lines changed

coderd/database/querier_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ func TestInsertWorkspaceAgentLogs(t *testing.T) {
112112
agent := dbgen.WorkspaceAgent(t, db, database.WorkspaceAgent{
113113
ResourceID: resource.ID,
114114
})
115-
source := dbgen.WorkspaceAgentLogSource(t, db, database.WorkspaceAgentLogSource{})
116-
115+
source := dbgen.WorkspaceAgentLogSource(t, db, database.WorkspaceAgentLogSource{
116+
WorkspaceAgentID: agent.ID,
117+
})
117118
logs, err := db.InsertWorkspaceAgentLogs(ctx, database.InsertWorkspaceAgentLogsParams{
118119
AgentID: agent.ID,
119120
CreatedAt: dbtime.Now(),

site/e2e/provisionerGenerated.ts

Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export interface Agent {
104104
id: string;
105105
name: string;
106106
env: { [key: string]: string };
107-
startupScript: string;
107+
/** Field 4 was startup_script, now removed. */
108108
operatingSystem: string;
109109
architecture: string;
110110
directory: string;
@@ -114,13 +114,14 @@ export interface Agent {
114114
connectionTimeoutSeconds: number;
115115
troubleshootingUrl: string;
116116
motdFile: string;
117-
/** Field 14 was bool login_before_ready = 14, now removed. */
118-
startupScriptTimeoutSeconds: number;
119-
shutdownScript: string;
120-
shutdownScriptTimeoutSeconds: number;
117+
/**
118+
* Field 14 was bool login_before_ready = 14, now removed.
119+
* Field 15, 16, 17 were related to scripts, which are now removed.
120+
*/
121121
metadata: Agent_Metadata[];
122-
startupScriptBehavior: string;
122+
/** Field 19 was startup_script_behavior, now removed. */
123123
displayApps: DisplayApps | undefined;
124+
scripts: Script[];
124125
}
125126

126127
export interface Agent_Metadata {
@@ -144,6 +145,19 @@ export interface DisplayApps {
144145
portForwardingHelper: boolean;
145146
}
146147

148+
/** Script represents a script to be run on the workspace. */
149+
export interface Script {
150+
displayName: string;
151+
icon: string;
152+
script: string;
153+
cron: string;
154+
startBlocksLogin: boolean;
155+
runOnStart: boolean;
156+
runOnStop: boolean;
157+
timeoutSeconds: number;
158+
logPath: string;
159+
}
160+
147161
/** App represents a dev-accessible application on the workspace. */
148162
export interface App {
149163
/**
@@ -470,9 +484,6 @@ export const Agent = {
470484
writer.uint32(26).fork(),
471485
).ldelim();
472486
});
473-
if (message.startupScript !== "") {
474-
writer.uint32(34).string(message.startupScript);
475-
}
476487
if (message.operatingSystem !== "") {
477488
writer.uint32(42).string(message.operatingSystem);
478489
}
@@ -500,27 +511,18 @@ export const Agent = {
500511
if (message.motdFile !== "") {
501512
writer.uint32(106).string(message.motdFile);
502513
}
503-
if (message.startupScriptTimeoutSeconds !== 0) {
504-
writer.uint32(120).int32(message.startupScriptTimeoutSeconds);
505-
}
506-
if (message.shutdownScript !== "") {
507-
writer.uint32(130).string(message.shutdownScript);
508-
}
509-
if (message.shutdownScriptTimeoutSeconds !== 0) {
510-
writer.uint32(136).int32(message.shutdownScriptTimeoutSeconds);
511-
}
512514
for (const v of message.metadata) {
513515
Agent_Metadata.encode(v!, writer.uint32(146).fork()).ldelim();
514516
}
515-
if (message.startupScriptBehavior !== "") {
516-
writer.uint32(154).string(message.startupScriptBehavior);
517-
}
518517
if (message.displayApps !== undefined) {
519518
DisplayApps.encode(
520519
message.displayApps,
521520
writer.uint32(162).fork(),
522521
).ldelim();
523522
}
523+
for (const v of message.scripts) {
524+
Script.encode(v!, writer.uint32(170).fork()).ldelim();
525+
}
524526
return writer;
525527
},
526528
};
@@ -588,6 +590,42 @@ export const DisplayApps = {
588590
},
589591
};
590592

593+
export const Script = {
594+
encode(
595+
message: Script,
596+
writer: _m0.Writer = _m0.Writer.create(),
597+
): _m0.Writer {
598+
if (message.displayName !== "") {
599+
writer.uint32(10).string(message.displayName);
600+
}
601+
if (message.icon !== "") {
602+
writer.uint32(18).string(message.icon);
603+
}
604+
if (message.script !== "") {
605+
writer.uint32(26).string(message.script);
606+
}
607+
if (message.cron !== "") {
608+
writer.uint32(34).string(message.cron);
609+
}
610+
if (message.startBlocksLogin === true) {
611+
writer.uint32(40).bool(message.startBlocksLogin);
612+
}
613+
if (message.runOnStart === true) {
614+
writer.uint32(48).bool(message.runOnStart);
615+
}
616+
if (message.runOnStop === true) {
617+
writer.uint32(56).bool(message.runOnStop);
618+
}
619+
if (message.timeoutSeconds !== 0) {
620+
writer.uint32(64).int32(message.timeoutSeconds);
621+
}
622+
if (message.logPath !== "") {
623+
writer.uint32(74).string(message.logPath);
624+
}
625+
return writer;
626+
},
627+
};
628+
591629
export const App = {
592630
encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
593631
if (message.slug !== "") {

0 commit comments

Comments
 (0)