Skip to content

Commit d1fd4b0

Browse files
committed
Merge remote-tracking branch 'upstream/main' into shared-restsnippet-suite
2 parents 1b23698 + 6ea292c commit d1fd4b0

23 files changed

Lines changed: 1082 additions & 73 deletions

File tree

src/test/Gradle9TestDevModeActions.ts

Lines changed: 457 additions & 0 deletions
Large diffs are not rendered by default.

src/test/GradleInitProject.ts

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

src/test/GradleTestDevModeActions.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ describe('Gradle-specific devmode action tests', () => {
165165
}
166166
}).timeout(30000);
167167

168-
// Based on the UI testing code, it sometimes selects the wrong command in "command palette", such as choosing "Liberty: Start ..." instead of "Liberty: Start" from the recent suggestions. This discrepancy occurs because we specifically need "Liberty: Start" at that moment.
169-
// Now, clear the command history of the "command palette" to avoid receiving "recently used" suggestions. This action should be performed at the end of Gradle Project tests.
170168
it('Clear Command Palette', async () => {
171169
logger.testStart('Clear Command Palette');
172170
try {
@@ -179,6 +177,13 @@ describe('Gradle-specific devmode action tests', () => {
179177
throw error;
180178
}
181179
}).timeout(100000);
182-
});
183-
184180

181+
/**
182+
* The following after hook closes the workspace and copies screenshots.
183+
* Closing the workspace ensures the next test file starts with a clean slate.
184+
*/
185+
after(async function() {
186+
this.timeout(10000);
187+
await utils.closeWorkspace();
188+
});
189+
});

src/test/MavenInitProject.ts

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

src/test/MavenTestDevModeActions.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ describe('Maven-specific devmode action tests', () => {
2828
dashboard = new DashboardPage();
2929
});
3030

31-
after(async function() {
32-
this.timeout(10000);
33-
try {
34-
await new EditorView().closeAllEditors();
35-
} catch (error) {
36-
logger.error('Failed to close editors after Maven-specific suite', error);
37-
}
38-
});
39-
4031
it('Start Maven with options from Liberty Tools', async () => {
4132
logger.testStart('Start Maven with options from Liberty Tools');
4233
try {
@@ -204,6 +195,12 @@ describe('Maven-specific devmode action tests', () => {
204195
throw error;
205196
}
206197
}).timeout(90000);
207-
});
208198

209-
// Made with Bob
199+
/**
200+
* The following after hook closes the workspace so the next test file starts with a clean slate.
201+
*/
202+
after(async function() {
203+
this.timeout(10000);
204+
await utils.closeWorkspace();
205+
});
206+
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import * as utils from './utils/testUtils';
22
import { runRestSnippetSuite } from './shared/restSnippetSuite';
33

4-
runRestSnippetSuite({ buildTool: 'maven', getProjectPath: utils.getMvnProjectPath });
4+
runRestSnippetSuite({ buildTool: 'maven', getProjectPath: utils.getMvnProjectPath });

src/test/definitions/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
export const MAVEN_PROJECT = "liberty-maven-test-wrapper-app";
77
export const GRADLE_PROJECT= "liberty-gradle-test-wrapper-app";
8+
export const GRADLE_9_PROJECT= "liberty-gradle-9-test-wrapper-app";
89
export const START_DASHBOARD_ACTION = "Start";
910
export const STOP_DASHBOARD_ACTION = "Stop";
1011
export const START_DASHBOARD_MAC_ACTION = "Liberty: Start";
@@ -29,6 +30,7 @@ export const ITR_DASHBOARD_MAC_ACTION = "Liberty: View integration test report";
2930
export const SUREFIRE_REPORT_TITLE = "liberty-maven-test-wrapper-app surefire report";
3031
export const FAILSAFE_REPORT_TITLE = "liberty-maven-test-wrapper-app failsafe report";
3132
export const GRADLE_TEST_REPORT_TITLE = "liberty-gradle-test-wrapper-app test report";
33+
export const GRADLE_9_TEST_REPORT_TITLE = "liberty-gradle-9-test-wrapper-app test report";
3234
export const ATTACH_DEBUGGER_DASHBOARD_ACTION = "Attach debugger";
3335
export const ATTACH_DEBUGGER_DASHBOARD_MAC_ACTION = "Liberty: Attach debugger";
3436
/** Maven: Dev mode debug port argument key. */

src/test/resources/ci/scripts/exec.sh

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -138,28 +138,29 @@ startDisplayAndDocker() {
138138

139139
#find current vscode version
140140
setVscodeVersionToTest() {
141-
latest_version=$(curl -s https://code.visualstudio.com/updates)
142-
current_version=$(echo $latest_version | cut -d"v" -f2 | sed 's/_/./g')
143-
144-
if echo "$current_version" | grep -qE '^[1-9]+\.[0-9]+$'; then
145-
echo "The string is a version string."
146-
previous_version=$(awk -F. '{print $1"."$2-1}' <<<$current_version)
147-
previousMinusOne=$(awk -F. '{print $1"."$2-2}' <<<$current_version)
148-
echo $current_version $previous_version $previousMinusOne
149-
else
150-
echo "The string is not a version string."
151-
current_version='latest'
152-
previous_version='latest'
153-
previousMinusOne='latest'
141+
if [[ $VSCODE_VERSION_TO_RUN == 'latest' ]]; then
142+
return
154143
fi
155144

156-
if [[ $VSCODE_VERSION_TO_RUN = 'latest' ]]; then
157-
VSCODE_VERSION_TO_RUN='latest'
158-
elif [[ $VSCODE_VERSION_TO_RUN = 'previous' ]]; then
159-
VSCODE_VERSION_TO_RUN="$previous_version.0"
160-
else
161-
VSCODE_VERSION_TO_RUN="$previousMinusOne.0"
145+
local versions_json
146+
versions_json=$(curl -sf "https://update.code.visualstudio.com/api/releases/stable")
147+
148+
if [[ -z "$versions_json" ]]; then
149+
echo "ERROR: Failed to fetch VS Code release list."
150+
exit 1
162151
fi
152+
153+
local all_versions latest_minor previous_version
154+
all_versions=$(echo "$versions_json" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
155+
latest_minor=$(echo "$all_versions" | head -1 | grep -oE '^[0-9]+\.[0-9]+')
156+
previous_version=$(echo "$all_versions" | grep -v "^${latest_minor}\." | head -1)
157+
158+
if [[ -z "$previous_version" ]]; then
159+
echo "ERROR: Could not extract previous VS Code version from release list."
160+
exit 1
161+
fi
162+
163+
VSCODE_VERSION_TO_RUN="$previous_version"
163164
}
164165

165166
# Finding the exit status of a command and updating failure boolean.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM icr.io/appcafe/open-liberty:kernel-slim-java17-openj9-ubi
2+
COPY --chown=1001:0 build/wlp/usr/servers/defaultServer/server.xml /config/
3+
RUN features.sh
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath 'io.openliberty.tools:liberty-gradle-plugin:4.0.0'
7+
}
8+
}
9+
10+
apply plugin: 'java'
11+
apply plugin: 'liberty'
12+
apply plugin: 'war'
13+
14+
version '1.0'
15+
group 'liberty-gradle-test-wrapper-app'
16+
17+
java {
18+
sourceCompatibility = JavaVersion.VERSION_17
19+
targetCompatibility = JavaVersion.VERSION_17
20+
}
21+
22+
tasks.withType(JavaCompile) {
23+
options.encoding = 'UTF-8'
24+
}
25+
26+
repositories {
27+
mavenCentral()
28+
}
29+
30+
dependencies {
31+
// provided dependencies
32+
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
33+
providedCompile 'org.eclipse.microprofile:microprofile:5.0'
34+
35+
// test dependencies
36+
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
37+
testImplementation 'org.apache.httpcomponents.client5:httpclient5:5.6.1'
38+
}
39+
40+
liberty {
41+
server{
42+
verifyAppStartTimeout = 150
43+
}
44+
}
45+
46+
clean.dependsOn 'libertyStop'

0 commit comments

Comments
 (0)