Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbac3a58

Browse files
authored
chore: add e2e test for backwards client ssh compatibility (#8958)
* chore: add e2e test for backwards client ssh compatibilityThis was discussed as part of our regression review for outdatedagents, so here is the reverse with an extremely old client.* fmt
1 parent73b136e commitbac3a58

File tree

2 files changed

+60
-10
lines changed

2 files changed

+60
-10
lines changed

‎site/e2e/helpers.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,18 @@ export const createTemplate = async (
6565
exportconstsshIntoWorkspace=async(
6666
page:Page,
6767
workspace:string,
68+
binaryPath="go",
69+
binaryArgs=["run",coderMainPath()],
6870
):Promise<ssh.Client>=>{
6971
constsessionToken=awaitfindSessionToken(page)
7072
returnnewPromise<ssh.Client>((resolve,reject)=>{
71-
constcp=spawn(
72-
"go",
73-
["run",coderMainPath(),"ssh","--stdio",workspace],
74-
{
75-
env:{
76-
...process.env,
77-
CODER_SESSION_TOKEN:sessionToken,
78-
CODER_URL:"http://localhost:3000",
79-
},
73+
constcp=spawn(binaryPath,[...binaryArgs,"ssh","--stdio",workspace],{
74+
env:{
75+
...process.env,
76+
CODER_SESSION_TOKEN:sessionToken,
77+
CODER_URL:"http://localhost:3000",
8078
},
81-
)
79+
})
8280
cp.on("error",(err)=>reject(err))
8381
constproxyStream=newDuplex({
8482
read:(size)=>{

‎site/e2e/tests/outdatedCLI.spec.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import{test}from"@playwright/test"
2+
import{randomUUID}from"crypto"
3+
import{
4+
createTemplate,
5+
createWorkspace,
6+
downloadCoderVersion,
7+
sshIntoWorkspace,
8+
startAgent,
9+
}from"../helpers"
10+
11+
constclientVersion="v0.14.0"
12+
13+
test("ssh with client "+clientVersion,async({ page})=>{
14+
consttoken=randomUUID()
15+
consttemplate=awaitcreateTemplate(page,{
16+
apply:[
17+
{
18+
complete:{
19+
resources:[
20+
{
21+
agents:[
22+
{
23+
token,
24+
},
25+
],
26+
},
27+
],
28+
},
29+
},
30+
],
31+
})
32+
constworkspace=awaitcreateWorkspace(page,template)
33+
awaitstartAgent(page,token)
34+
constbinaryPath=awaitdownloadCoderVersion(clientVersion)
35+
36+
constclient=awaitsshIntoWorkspace(page,workspace,binaryPath)
37+
awaitnewPromise<void>((resolve,reject)=>{
38+
// We just exec a command to be certain the agent is running!
39+
client.exec("exit 0",(err,stream)=>{
40+
if(err){
41+
returnreject(err)
42+
}
43+
stream.on("exit",(code)=>{
44+
if(code!==0){
45+
returnreject(newError(`Command exited with code${code}`))
46+
}
47+
client.end()
48+
resolve()
49+
})
50+
})
51+
})
52+
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp