forked from apache/skywalking
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e test setup. cc @hanahmily @peng-yongsheng @IanCao @zhaoyuguang @JaredTan95 # e2e test case One single standalone Spring service, accessing H2 database. This service has been installed the agent. OAP runs in single mode with H2 storage too. The e2e test will verify the results through GraphQL query 1. Traces exist. 2. Service/Service Instance/Endpoint exist and have expected metrics. 3. Topology exists and match expected.
- Loading branch information
1 parent
7f3ff15
commit d1a521b
Showing
66 changed files
with
4,146 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
pipeline { | ||
agent { | ||
label 'xenial' | ||
} | ||
|
||
tools { | ||
jdk 'JDK 1.8 (latest)' | ||
} | ||
|
||
stages { | ||
stage('Checkout Source Code') { | ||
steps { | ||
deleteDir() | ||
checkout scm | ||
sh 'git submodule update --init' | ||
} | ||
} | ||
|
||
stage('Prepare Distribution Package') { | ||
steps { | ||
sh './mvnw -DskipTests clean package' | ||
sh 'tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist' | ||
} | ||
} | ||
|
||
stage('Run End-to-End Tests') { | ||
steps { | ||
sh './mvnw -Dbuild.id=${BUILD_ID} -f test/e2e/pom.xml clean verify' | ||
} | ||
} | ||
} | ||
|
||
post { | ||
always { | ||
// "Abort old build on update" will interrupt the job completely, | ||
// we need to clean up when there are containers started by the e2e tests | ||
sh 'docker ps' | ||
sh 'docker ps | grep -e "skywalking-e2e-container-${BUILD_ID}" | awk \'{print $1}\' | xargs --no-run-if-empty docker stop' | ||
deleteDir() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
~ (the "License"); you may not use this file except in compliance with | ||
~ the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>apache-skywalking-e2e</artifactId> | ||
<groupId>org.apache.skywalking</groupId> | ||
<version>1.0.0</version> | ||
</parent> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>e2e-base</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.yaml</groupId> | ||
<artifactId>snakeyaml</artifactId> | ||
<version>${snake.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-yaml</artifactId> | ||
<version>${jackson.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
90 changes: 90 additions & 0 deletions
90
test/e2e/e2e-base/src/main/java/org/apache/skywalking/e2e/AbstractQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.apache.skywalking.e2e; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.ZoneOffset; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
/** | ||
* @author kezhenxu94 | ||
*/ | ||
public abstract class AbstractQuery<T extends AbstractQuery<?>> { | ||
private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HHmmss"); | ||
private static final DateTimeFormatter MINUTE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HHmm"); | ||
|
||
private String start; | ||
private String end; | ||
private String step = "SECOND"; | ||
|
||
public String start() { | ||
if (start != null) { | ||
return start; | ||
} | ||
return "SECOND".equals(step()) | ||
? LocalDateTime.now(ZoneOffset.UTC).minusMinutes(5).format(TIME_FORMATTER) | ||
: LocalDateTime.now(ZoneOffset.UTC).minusMinutes(5).format(MINUTE_TIME_FORMATTER); | ||
} | ||
|
||
public T start(String start) { | ||
this.start = start; | ||
return (T) this; | ||
} | ||
|
||
public T start(LocalDateTime start) { | ||
if ("MINUTE".equals(step())) { | ||
this.start = start.format(MINUTE_TIME_FORMATTER); | ||
} else if ("SECOND".equals(step())) { | ||
this.start = start.format(TIME_FORMATTER); | ||
} | ||
return (T) this; | ||
} | ||
|
||
public String end() { | ||
if (end != null) { | ||
return end; | ||
} | ||
return "SECOND".equals(step()) | ||
? LocalDateTime.now(ZoneOffset.UTC).format(TIME_FORMATTER) | ||
: LocalDateTime.now(ZoneOffset.UTC).format(MINUTE_TIME_FORMATTER); | ||
} | ||
|
||
public AbstractQuery end(String end) { | ||
this.end = end; | ||
return this; | ||
} | ||
|
||
public T end(LocalDateTime end) { | ||
if ("MINUTE".equals(step())) { | ||
this.end = end.format(MINUTE_TIME_FORMATTER); | ||
} else if ("SECOND".equals(step())) { | ||
this.end = end.format(TIME_FORMATTER); | ||
} | ||
return (T) this; | ||
} | ||
|
||
public String step() { | ||
return step; | ||
} | ||
|
||
public T step(String step) { | ||
this.step = step; | ||
return (T) this; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
test/e2e/e2e-base/src/main/java/org/apache/skywalking/e2e/GQLResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.apache.skywalking.e2e; | ||
|
||
/** | ||
* GraphQL response for easily test | ||
* | ||
* @author kezhenxu94 | ||
*/ | ||
public class GQLResponse<T> { | ||
private T data; | ||
|
||
public T getData() { | ||
return data; | ||
} | ||
|
||
public void setData(final T data) { | ||
this.data = data; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "GQLResponse{" + | ||
"data=" + data + | ||
'}'; | ||
} | ||
} |
Oops, something went wrong.