Skip to content

Commit 49c246c

Browse files
committed
[test] 验证github action失败原因
1 parent a2e727a commit 49c246c

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

framework/fel/java/services/tool-service/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,20 @@
9999
<groupId>org.assertj</groupId>
100100
<artifactId>assertj-core</artifactId>
101101
</dependency>
102+
<dependency>
103+
<groupId>org.slf4j</groupId>
104+
<artifactId>slf4j-api</artifactId>
105+
<version>1.7.36</version>
106+
</dependency>
107+
<dependency>
108+
<groupId>org.apache.logging.log4j</groupId>
109+
<artifactId>log4j-api</artifactId>
110+
<version>2.24.3</version>
111+
</dependency>
112+
<dependency>
113+
<groupId>org.apache.logging.log4j</groupId>
114+
<artifactId>log4j-core</artifactId>
115+
<version>2.24.3</version>
116+
</dependency>
102117
</dependencies>
103118
</project>

framework/fel/java/services/tool-service/src/test/java/modelengine/fel/tool/support/HttpToolTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
* @since 2024-06-12
5050
*/
5151
public class HttpToolTest {
52+
private static final org.apache.logging.log4j.Logger log =
53+
org.apache.logging.log4j.LogManager.getLogger(HttpToolTest.class);
54+
5255
private static final String TOOL_PATH = "tool/";
5356
private static Integer port = null;
5457
private static final String DEFINITION_GROUP_NAME = "test_definition_group_name";
@@ -66,11 +69,13 @@ static void setupAll() {
6669
if (port == null) {
6770
port = getLocalAvailablePort();
6871
}
72+
log.warn("!!!test in github action!!! setup all: port: {}", port);
6973
TestFitRuntime.INSTANCE.start(port);
7074
}
7175

7276
@AfterAll
7377
static void teardownAll() {
78+
log.warn("!!!test in github action!!! teardown all");
7479
TestFitRuntime.INSTANCE.stop();
7580
}
7681

@@ -132,11 +137,13 @@ void shouldReturnMap() {
132137

133138
Address address = Address.create("jiangsu", "suzhou", 3205);
134139
Education education = Education.create("QUST", "UCAS");
140+
log.warn("!!!test in github action!!! test shouldReturnMap, before execute tool");
135141
Map<String, Object> result = cast(tool.execute("Alice",
136142
26,
137143
address,
138144
education,
139145
Stream.of("0123-4567-8888", "0123-4567-9999").collect(Collectors.toList())));
146+
log.warn("!!!test in github action!!! test shouldReturnMap, after execute tool");
140147
Map<String, Object> addressResult = cast(result.get("address"));
141148
Map<String, Object> educationResult = cast(result.get("education"));
142149
List<String> phoneNumbers = cast(result.get("phoneNumbers"));
@@ -156,7 +163,9 @@ void shouldReturnString() {
156163
Tool.Info info = readToolInfo("string.json");
157164
Tool tool = createTool(info);
158165

166+
log.warn("!!!test in github action!!! test shouldReturnString, before execute tool");
159167
String result = cast(tool.execute(Stream.of("abc", "def", "ghi").collect(Collectors.toList())));
168+
log.warn("!!!test in github action!!! test shouldReturnString, after execute tool");
160169
assertThat(result).isEqualTo("abc,def,ghi");
161170
}
162171

@@ -166,7 +175,9 @@ void shouldReturnInteger() {
166175
Tool.Info info = readToolInfo("integer.json");
167176
Tool tool = createTool(info);
168177

178+
log.warn("!!!test in github action!!! test shouldReturnInteger, before execute tool");
169179
Integer result = cast(tool.execute(Stream.of(1, 2, 3).collect(Collectors.toList())));
180+
log.warn("!!!test in github action!!! test shouldReturnInteger, after execute tool");
170181
assertThat(result).isEqualTo(6);
171182
}
172183

@@ -176,7 +187,9 @@ void shouldReturnNull() {
176187
Tool.Info info = readToolInfo("void.json");
177188
Tool tool = createTool(info);
178189

190+
log.warn("!!!test in github action!!! test shouldReturnNull, before execute tool");
179191
Object result = tool.execute();
192+
log.warn("!!!test in github action!!! test shouldReturnNull, after execute tool");
180193
assertThat(result).isEqualTo(null);
181194
}
182195

@@ -186,7 +199,9 @@ void BasicShouldReturnOk() {
186199
Tool.Info info = readToolInfo("basic-auth.json");
187200
Tool tool = createTool(info);
188201

202+
log.warn("!!!test in github action!!! test BasicShouldReturnOk, before execute tool");
189203
boolean result = cast(tool.execute("{\"name\":\"testuser\", \"pwd\":\"testpass\"}"));
204+
log.warn("!!!test in github action!!! test BasicShouldReturnOk, after execute tool");
190205
assertThat(result).isEqualTo(true);
191206
}
192207

@@ -196,7 +211,9 @@ void ApiKeyShouldReturnOk() {
196211
Tool.Info info = readToolInfo("api-key-auth.json");
197212
Tool tool = createTool(info);
198213

214+
log.warn("!!!test in github action!!! test ApiKeyShouldReturnOk, before execute tool");
199215
boolean result = cast(tool.execute("{\"name\":\"ApiKey\", \"pwd\":\"ApiKeyValue\"}"));
216+
log.warn("!!!test in github action!!! test ApiKeyShouldReturnOk, after execute tool");
200217
assertThat(result).isEqualTo(true);
201218
}
202219

@@ -206,7 +223,9 @@ void ApiKeyQueryShouldReturnOk() {
206223
Tool.Info info = readToolInfo("api-key-query-auth.json");
207224
Tool tool = createTool(info);
208225

226+
log.warn("!!!test in github action!!! test ApiKeyQueryShouldReturnOk, before execute tool");
209227
boolean result = cast(tool.execute("{\"name\":\"ApiKey\", \"pwd\":\"ApiKeyValue\"}"));
228+
log.warn("!!!test in github action!!! test ApiKeyQueryShouldReturnOk, after execute tool");
210229
assertThat(result).isEqualTo(true);
211230
}
212231

@@ -216,7 +235,9 @@ void BearerShouldReturnOk() {
216235
Tool.Info info = readToolInfo("bearer-auth.json");
217236
Tool tool = createTool(info);
218237

238+
log.warn("!!!test in github action!!! test BearerShouldReturnOk, before execute tool");
219239
boolean result = cast(tool.execute("{\"name\":\"test666666666\", \"pwd\":\"invalid\"}"));
240+
log.warn("!!!test in github action!!! test BearerShouldReturnOk, after execute tool");
220241
assertThat(result).isEqualTo(true);
221242
}
222243
}

0 commit comments

Comments
 (0)