From 7cb98c34b0e12ac69697526fb357b958f1f80789 Mon Sep 17 00:00:00 2001 From: Andrea Falzetti Date: Fri, 13 Jan 2023 18:59:50 +0000 Subject: [PATCH] run 2 jb ide tests in parallel --- .werft/installer-tests.ts | 47 ++++++++++++++---------- test/run.sh | 5 ++- test/tests/ide/jetbrains/gateway_test.go | 20 +++++++--- 3 files changed, 46 insertions(+), 26 deletions(-) diff --git a/.werft/installer-tests.ts b/.werft/installer-tests.ts index d8b6dd79976f41..9a2ab57d52c14c 100644 --- a/.werft/installer-tests.ts +++ b/.werft/installer-tests.ts @@ -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, } @@ -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, } @@ -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 } diff --git a/test/run.sh b/test/run.sh index 3cbefa9586102d..d700d2f921d0ed 100755 --- a/test/run.sh +++ b/test/run.sh @@ -17,6 +17,7 @@ set -euo pipefail REPORT="" TEST_SUITE=all +PARALLEL_FLAG="" opt="" optarg="" while getopts rs-: opt; do @@ -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" @@ -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 diff --git a/test/tests/ide/jetbrains/gateway_test.go b/test/tests/ide/jetbrains/gateway_test.go index dee6c1c2d81df0..a6a4e75d73548a 100644 --- a/test/tests/ide/jetbrains/gateway_test.go +++ b/test/tests/ide/jetbrains/gateway_test.go @@ -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"). @@ -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"). @@ -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"). @@ -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"). @@ -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"). @@ -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"). @@ -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"). @@ -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").