Skip to content

Commit

Permalink
run 2 jb ide tests in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Falzetti committed Jan 18, 2023
1 parent 09fef50 commit 7cb98c3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 26 deletions.
47 changes: 28 additions & 19 deletions .werft/installer-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,25 +226,31 @@ const WORKSPACES_TESTS: { [name: string]: InfraConfig } = {
},
};

const SSH_TEST = {
phase: "run-ssh-tests",
makeTarget: "run-ssh-tests",
description: "SSH Gateway tests",
slackhook: slackHook.get("ide-jobs"),
};

const VSCODE_IDE_TEST = {
phase: "run-vscode-ide-tests",
makeTarget: "run-vscode-ide-tests",
description: "vscode IDE tests",
slackhook: slackHook.get("ide-jobs"),
};

const JB_IDE_TEST = {
phase: "run-jb-ide-tests",
makeTarget: "run-jb-ide-tests",
description: "jetbrains IDE tests",
slackhook: slackHook.get("ide-jobs"),
}

const IDE_TESTS: { [name: string]: InfraConfig } = {
SSH_TEST: {
phase: "run-ssh-tests",
makeTarget: "run-ssh-tests",
description: "SSH Gateway tests",
slackhook: slackHook.get("ide-jobs"),
},
VSCODE_IDE_TEST: {
phase: "run-vscode-ide-tests",
makeTarget: "run-vscode-ide-tests",
description: "vscode IDE tests",
slackhook: slackHook.get("ide-jobs"),
},
JB_IDE_TEST: {
phase: "run-jb-ide-tests",
makeTarget: "run-jb-ide-tests",
description: "jetbrains IDE tests",
slackhook: slackHook.get("ide-jobs"),
},
SSH_TEST,
VSCODE_IDE_TEST,
JB_IDE_TEST,
}


Expand Down Expand Up @@ -274,6 +280,9 @@ const WEBAPP_TESTS: { [name: string]: InfraConfig } = {
const TestMap = {
"workspaces": WORKSPACES_TESTS,
"ide": IDE_TESTS,
"ssh": SSH_TEST,
"vscode": VSCODE_IDE_TEST,
"jetbrains": JB_IDE_TEST,
"webapp": WEBAPP_TESTS,
}

Expand Down Expand Up @@ -427,7 +436,7 @@ async function runIntegrationTests() {

const componentTests = TestMap[testSuite.toLowerCase()]
if(componentTests === undefined) {
console.log("'%s' is not a valid testSuite name, options are: 'workspaces', 'ide', 'webapp'", testSuite)
console.log("'%s' is not a valid testSuite name, options are: 'workspaces', 'ide', 'ssh', 'vscode', 'jetbrains', 'webapp'", testSuite)
werft.fail(`run-${testSuite}-integration-tests`, "Error finding the testSuite")
return
}
Expand Down
5 changes: 4 additions & 1 deletion test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set -euo pipefail

REPORT=""
TEST_SUITE=all
PARALLEL_FLAG=""
opt=""
optarg=""
while getopts rs-: opt; do
Expand Down Expand Up @@ -54,9 +55,11 @@ case $TEST_SUITE in
;;
"ide")
TEST_LIST="$IDE_TEST_LIST"
PARALLEL_FLAG="-parallel 2"
;;
"jetbrains")
TEST_LIST="$JETBRAINS_TESTS"
PARALLEL_FLAG="-parallel 2"
;;
"vscode")
TEST_LIST="$VSCODE_TESTS"
Expand Down Expand Up @@ -109,7 +112,7 @@ if [ "$TEST_SUITE" == "workspace" ]; then

set +e
# shellcheck disable=SC2086
go test -v $TEST_LIST "${args[@]}" -run '.*[^.SerialOnly]$' 2>&1 | tee "${LOG_FILE}" | werft log slice "test-${TEST_NAME}-parallel"
go test -v $TEST_LIST "${args[@]}" -run '.*[^.SerialOnly]$' $PARALLEL_FLAG 2>&1 | tee "${LOG_FILE}" | werft log slice "test-${TEST_NAME}-parallel"
RC=${PIPESTATUS[0]}
set -e

Expand Down
20 changes: 14 additions & 6 deletions test/tests/ide/jetbrains/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func TestGoLand(t *testing.T) {
if roboquatToken == "" {
t.Fatal("this test need github action run permission")
}
t.Parallel()
f := features.New("Start a workspace using GoLand").
WithLabel("component", "IDE").
WithLabel("ide", "GoLand").
Expand All @@ -210,6 +211,7 @@ func TestIntellij(t *testing.T) {
if roboquatToken == "" {
t.Fatal("this test need github action run permission")
}
t.Parallel()
f := features.New("Start a workspace using Intellij").
WithLabel("component", "IDE").
WithLabel("ide", "Intellij").
Expand All @@ -229,6 +231,7 @@ func TestPhpStorm(t *testing.T) {
if roboquatToken == "" {
t.Fatal("this test need github action run permission")
}
t.Parallel()
f := features.New("Start a workspace using PhpStorm").
WithLabel("component", "IDE").
WithLabel("ide", "PhpStorm").
Expand All @@ -248,6 +251,7 @@ func TestPyCharm(t *testing.T) {
if roboquatToken == "" {
t.Fatal("this test need github action run permission")
}
t.Parallel()
f := features.New("Start a workspace using Pycharm").
WithLabel("component", "IDE").
WithLabel("ide", "Pycharm").
Expand All @@ -267,6 +271,7 @@ func TestRubyMine(t *testing.T) {
if roboquatToken == "" {
t.Fatal("this test need github action run permission")
}
t.Parallel()
f := features.New("Start a workspace using RubyMine").
WithLabel("component", "IDE").
WithLabel("ide", "RubyMine").
Expand All @@ -286,6 +291,7 @@ func TestWebStorm(t *testing.T) {
if roboquatToken == "" {
t.Fatal("this test need github action run permission")
}
t.Parallel()
f := features.New("Start a workspace using WebStorm").
WithLabel("component", "IDE").
WithLabel("ide", "WebStorm").
Expand All @@ -300,11 +306,12 @@ func TestWebStorm(t *testing.T) {
}

func TestRider(t *testing.T) {
if roboquatToken == "" {
t.Skip("this test need github action run permission")
}
integration.SkipWithoutUsername(t, username)
integration.SkipWithoutUserToken(t, userToken)
if roboquatToken == "" {
t.Fatal("this test need github action run permission")
}
t.Parallel()
f := features.New("Start a workspace using Rider").
WithLabel("component", "IDE").
WithLabel("ide", "Rider").
Expand All @@ -319,11 +326,12 @@ func TestRider(t *testing.T) {
}

func TestCLion(t *testing.T) {
if roboquatToken == "" {
t.Skip("this test need github action run permission")
}
integration.SkipWithoutUsername(t, username)
integration.SkipWithoutUserToken(t, userToken)
if roboquatToken == "" {
t.Fatal("this test need github action run permission")
}
t.Parallel()
f := features.New("Start a workspace using CLion").
WithLabel("component", "IDE").
WithLabel("ide", "CLion").
Expand Down

0 comments on commit 7cb98c3

Please sign in to comment.