Skip to content

Commit eca4fb6

Browse files
committed
1
1 parent 854c81c commit eca4fb6

File tree

21 files changed

+882
-89
lines changed

21 files changed

+882
-89
lines changed
Lines changed: 71 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,74 @@
1-
name: JB Nightly
1+
name: JetBrains Test
22
on:
33
workflow_dispatch:
4-
schedule:
5-
# At 11:00 on every day.
6-
- cron: "0 11 * * *"
7-
4+
inputs:
5+
secret_gateway_link:
6+
type: string
7+
description: Gateway Link
8+
required: true
9+
secret_access_token:
10+
type: string
11+
description: OAuth2 Access Token
12+
required: true
13+
secret_endpoint:
14+
type: string
15+
description: IDE Endpoint
16+
required: true
817
jobs:
9-
intellij:
10-
uses: ./.github/workflows/jetbrains-auto-update-template.yml
11-
with:
12-
productId: intellij
13-
productCode: IIU
14-
secrets:
15-
projectId: ${{ secrets.GCP_PROJECT_ID }}
16-
serviceAccountKey: ${{ secrets.GCP_SA_KEY }}
17-
slackWebhook: ${{ secrets.IDE_SLACK_WEBHOOK }}
18-
goland:
19-
uses: ./.github/workflows/jetbrains-auto-update-template.yml
20-
with:
21-
productId: goland
22-
productCode: GO
23-
secrets:
24-
projectId: ${{ secrets.GCP_PROJECT_ID }}
25-
serviceAccountKey: ${{ secrets.GCP_SA_KEY }}
26-
slackWebhook: ${{ secrets.IDE_SLACK_WEBHOOK }}
27-
pycharm:
28-
uses: ./.github/workflows/jetbrains-auto-update-template.yml
29-
with:
30-
productId: pycharm
31-
productCode: PCP
32-
secrets:
33-
projectId: ${{ secrets.GCP_PROJECT_ID }}
34-
serviceAccountKey: ${{ secrets.GCP_SA_KEY }}
35-
slackWebhook: ${{ secrets.IDE_SLACK_WEBHOOK }}
36-
phpstorm:
37-
uses: ./.github/workflows/jetbrains-auto-update-template.yml
38-
with:
39-
productId: phpstorm
40-
productCode: PS
41-
secrets:
42-
projectId: ${{ secrets.GCP_PROJECT_ID }}
43-
serviceAccountKey: ${{ secrets.GCP_SA_KEY }}
44-
slackWebhook: ${{ secrets.IDE_SLACK_WEBHOOK }}
18+
jetbrains-smoke-test-mac:
19+
runs-on: macos-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-go@v2
23+
with:
24+
go-version: '1.17.3'
25+
- uses: actions/setup-java@v2
26+
with:
27+
distribution: zulu
28+
java-version: "11"
29+
# - name: Auth Google Cloud SDK
30+
# uses: google-github-actions/auth@v0
31+
# with:
32+
# credentials_json: ${{ secrets.serviceAccountKey }}
33+
# - name: Setup Google
34+
# uses: google-github-actions/setup-gcloud@v0
35+
# with:
36+
# project_id: ${{ secrets.projectId }}
37+
- name: Setup FFmpeg
38+
uses: FedericoCarboni/setup-ffmpeg@v1
39+
with:
40+
# Not strictly necessary, but it may prevent rate limit
41+
# errors especially on GitHub-hosted macos machines.
42+
token: ${{ secrets.GITHUB_TOKEN }}
43+
- name: Build Gateway Plugin
44+
working-directory: components/ide/jetbrains/gateway-plugin
45+
run: |
46+
./gradlew -PpluginVersion=test buildPlugin
47+
- name: Smoke Test
48+
env:
49+
LEEWAY_REMOTE_CACHE_BUCKET: gitpod-core-leeway-cache-branch
50+
working-directory: dev/jetbrains-test
51+
run: |
52+
mkdir ./build && cp -r ../../components/ide/jetbrains/gateway-plugin/build/distributions/gitpod-gateway-test.zip build/gateway-test.zip
53+
54+
export GATEWAY_LINK=$(jq -r '.inputs.secret_gateway_link' $GITHUB_EVENT_PATH)
55+
export GITPOD_TEST_ACCESSTOKEN=$(jq -r '.inputs.secret_access_token' $GITHUB_EVENT_PATH)
56+
export WS_ENDPOINT=$(jq -r '.inputs.secret_endpoint' $GITHUB_EVENT_PATH)
57+
export GATEWAY_PLUGIN_PATH=$(pwd)/build/gateway-test.zip
58+
59+
echo "$WS_ENDPOINT ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDMaWYf9zrhI79dA9iBi7qF1anYtUCdT9l0xG2w9oNKHezKuSrJb+pFbHPsL/HuBHK8Yx1HJEufE4uIv//WGCOlCIdW4D40aKhEu5WXtpo8zI0SxkuOvaWDRuUbYNb3/oNNo79WNuhXR6mWn5skm6D+J5vv8H7V5tYrsZf6UqYZF5uLkeQFsis0UVm3+jNFVY/PuHbo6ndrh9DFCQF4YhMQpGTAG0PLal4VLJ4L31TOnb3buBtCWcf3CslT8IiqREdFcJE6MjaMVMCgENQHRWQ57vjv0xKxoI/sA1tMMzD8KrZxC+yB7Qwiby/8iAuhb1Zluh8sxH0NBv8fh1zI8rxbwP5pG3MnTxsCKYpBN01hyuFWtruARfrEGtSMZ4z5oMAFl08BuXSq+e1Ty/dEjfxv2EuG6enU0EJezqJLeCLWqVPZw7hncJD74J4H2pHlk9v3/q9EAD83GY++IChChBLK6wQybEVk+Md7n9GxjCiDAowspSTnq5FHPuKRjDpc1s8=" >> ~/.ssh/known_hosts
60+
echo "$WS_ENDPOINT ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDMaWYf9zrhI79dA9iBi7qF1anYtUCdT9l0xG2w9oNKHezKuSrJb+pFbHPsL/HuBHK8Yx1HJEufE4uIv//WGCOlCIdW4D40aKhEu5WXtpo8zI0SxkuOvaWDRuUbYNb3/oNNo79WNuhXR6mWn5skm6D+J5vv8H7V5tYrsZf6UqYZF5uLkeQFsis0UVm3+jNFVY/PuHbo6ndrh9DFCQF4YhMQpGTAG0PLal4VLJ4L31TOnb3buBtCWcf3CslT8IiqREdFcJE6MjaMVMCgENQHRWQ57vjv0xKxoI/sA1tMMzD8KrZxC+yB7Qwiby/8iAuhb1Zluh8sxH0NBv8fh1zI8rxbwP5pG3MnTxsCKYpBN01hyuFWtruARfrEGtSMZ4z5oMAFl08BuXSq+e1Ty/dEjfxv2EuG6enU0EJezqJLeCLWqVPZw7hncJD74J4H2pHlk9v3/q9EAD83GY++IChChBLK6wQybEVk+Md7n9GxjCiDAowspSTnq5FHPuKRjDpc1s8=" >> ~/.ssh/known_hosts
61+
mkdir -p ~/Library/Application\ Support/JetBrains/consentOptions
62+
echo -n "rsch.send.usage.stat:1.1:0:1644945193441" > ~/Library/Application\ Support/JetBrains/consentOptions/accpeted
63+
gradle :test
64+
- name: Move video
65+
if: always()
66+
run: |
67+
cp -r dev/jetbrains-test/video dev/jetbrains-test/build/reports
68+
- name: Save report
69+
if: always()
70+
uses: actions/upload-artifact@v2
71+
with:
72+
name: video
73+
path: |
74+
dev/jetbrains-test/build/reports

.idea/compiler.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/ide/jetbrains/gateway-plugin/src/main/kotlin/io/gitpod/jetbrains/auth/GitpodAuthService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ internal class GitpodAuthService : OAuthServiceBase<Credentials>() {
171171
getAccessToken(gitpodHost) != null
172172

173173
fun getAccessToken(gitpodHost: String) =
174-
PasswordSafe.instance.getPassword(getAccessTokenCredentialAttributes(gitpodHost))
174+
System.getenv("GITPOD_TEST_ACCESSTOKEN") ?: PasswordSafe.instance.getPassword(getAccessTokenCredentialAttributes(gitpodHost))
175175

176176
fun setAccessToken(gitpodHost: String, accessToken: String?) {
177177
PasswordSafe.instance.setPassword(getAccessTokenCredentialAttributes(gitpodHost), accessToken)

dev/jetbrains-test/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.gradle
2+
.idea
3+
build
4+
bin

dev/jetbrains-test/build.gradle

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
plugins {
2+
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
3+
}
4+
5+
group 'org.example'
6+
version '1.0-SNAPSHOT'
7+
8+
repositories {
9+
mavenCentral()
10+
maven { url = "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies" }
11+
}
12+
13+
test {
14+
systemProperty 'video.save.mode', 'ALL'
15+
systemProperty 'gateway_link', System.getenv('GATEWAY_LINK')
16+
systemProperty 'gateway_plugin_path', System.getenv('GATEWAY_PLUGIN_PATH')
17+
useJUnitPlatform()
18+
}
19+
20+
dependencies {
21+
implementation "org.jetbrains.kotlin:kotlin-stdlib"
22+
23+
implementation("com.google.code.gson:gson:2.8.9")
24+
implementation("com.squareup.okhttp3:okhttp:4.9.3")
25+
implementation("com.intellij.remoterobot:remote-robot:0.11.12")
26+
implementation("com.intellij.remoterobot:remote-fixtures:0.11.12")
27+
28+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
29+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
30+
31+
// Logging Network Calls
32+
testImplementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
33+
34+
// Video Recording
35+
implementation 'com.automation-remarks:video-recorder-junit5:2.0'
36+
}

dev/jetbrains-test/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kotlin.code.style=official
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

dev/jetbrains-test/gradlew.bat

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
17+
@if "%DEBUG%" == "" @echo off
18+
@rem ##########################################################################
19+
@rem
20+
@rem Gradle startup script for Windows
21+
@rem
22+
@rem ##########################################################################
23+
24+
@rem Set local scope for the variables with windows NT shell
25+
if "%OS%"=="Windows_NT" setlocal
26+
27+
set DIRNAME=%~dp0
28+
if "%DIRNAME%" == "" set DIRNAME=.
29+
set APP_BASE_NAME=%~n0
30+
set APP_HOME=%DIRNAME%
31+
32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
35+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37+
38+
@rem Find java.exe
39+
if defined JAVA_HOME goto findJavaFromJavaHome
40+
41+
set JAVA_EXE=java.exe
42+
%JAVA_EXE% -version >NUL 2>&1
43+
if "%ERRORLEVEL%" == "0" goto execute
44+
45+
echo.
46+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47+
echo.
48+
echo Please set the JAVA_HOME variable in your environment to match the
49+
echo location of your Java installation.
50+
51+
goto fail
52+
53+
:findJavaFromJavaHome
54+
set JAVA_HOME=%JAVA_HOME:"=%
55+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56+
57+
if exist "%JAVA_EXE%" goto execute
58+
59+
echo.
60+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61+
echo.
62+
echo Please set the JAVA_HOME variable in your environment to match the
63+
echo location of your Java installation.
64+
65+
goto fail
66+
67+
:execute
68+
@rem Setup the command line
69+
70+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71+
72+
73+
@rem Execute Gradle
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75+
76+
:end
77+
@rem End local scope for the variables with windows NT shell
78+
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
80+
:fail
81+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82+
rem the _cmd.exe /c_ return code!
83+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84+
exit /b 1
85+
86+
:mainEnd
87+
if "%OS%"=="Windows_NT" endlocal
88+
89+
:omega

dev/jetbrains-test/settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rootProject.name = 'jetbrains-test'
2+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package io.gitpod.jetbrains.launcher
2+
3+
enum class Ide(val code: String, val feedsCode: String) {
4+
IDEA_COMMUNITY("IC", "IIC"),
5+
IDEA_ULTIMATE("IU", "IIU"),
6+
CLION("CL", "CL"),
7+
WEBSTORM("WS", "WS"),
8+
RUBY_MINE("RM", "RM"),
9+
PYCHARM("PY", "PCP"),
10+
GATEWAY("GW", "GW");
11+
12+
fun getIdePropertiesEnvVarName() = when (this) {
13+
IDEA_COMMUNITY, IDEA_ULTIMATE -> "IDEA_PROPERTIES"
14+
CLION -> "CLION_PROPERTIES"
15+
WEBSTORM -> if (Os.hostOS() == Os.MAC) "WEBSTORM_PROPERTIES" else "WEBIDE_PROPERTIES"
16+
RUBY_MINE -> "RUBYMINE_PROPERTIES"
17+
PYCHARM -> "PYCHARM_PROPERTIES"
18+
GATEWAY -> "GATEWAY_PROPERTIES"
19+
}
20+
21+
fun getVmOptionsEnvVarName() = when (this) {
22+
IDEA_COMMUNITY, IDEA_ULTIMATE -> "IDEA_VM_OPTIONS"
23+
CLION -> "CLION_VM_OPTIONS"
24+
WEBSTORM -> if (Os.hostOS() == Os.MAC) "WEBSTORM_VM_OPTIONS" else "WEBIDE_VM_OPTIONS"
25+
RUBY_MINE -> "RUBYMINE_VM_OPTIONS"
26+
PYCHARM -> "PYCHARM_VM_OPTIONS"
27+
GATEWAY -> "GATEWAY_VM_OPTIONS"
28+
}.let {
29+
if (Os.hostOS() == Os.WINDOWS) {
30+
val productPrefix = it.substringBefore("_")
31+
"${productPrefix}64${it.removePrefix(productPrefix)}"
32+
} else {
33+
it
34+
}
35+
}
36+
37+
companion object {
38+
fun withCode(code: String) = values().single { it.code == code }
39+
}
40+
}

0 commit comments

Comments
 (0)