-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from JinHai-CN/0.5.0
Add all test cases
- Loading branch information
Showing
78 changed files
with
10,800 additions
and
0 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
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,4 @@ | ||
target/ | ||
.idea/ | ||
test-output/ | ||
lib/* |
Empty file.
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,10 @@ | ||
def FileTransfer (sourceFiles, remoteDirectory, remoteIP, protocol = "ftp", makeEmptyDirs = true) { | ||
if (protocol == "ftp") { | ||
ftpPublisher masterNodeName: '', paramPublish: [parameterName: ''], alwaysPublishFromMaster: false, continueOnError: false, failOnError: true, publishers: [ | ||
[configName: "${remoteIP}", transfers: [ | ||
[asciiMode: false, cleanRemote: false, excludes: '', flatten: false, makeEmptyDirs: "${makeEmptyDirs}", noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: "${remoteDirectory}", remoteDirectorySDF: false, removePrefix: '', sourceFiles: "${sourceFiles}"]], usePromotionTimestamp: true, useWorkspaceInPromotion: false, verbose: true | ||
] | ||
] | ||
} | ||
} | ||
return this |
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,13 @@ | ||
try { | ||
def result = sh script: "helm status ${env.JOB_NAME}-${env.BUILD_NUMBER}", returnStatus: true | ||
if (!result) { | ||
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}" | ||
} | ||
} catch (exc) { | ||
def result = sh script: "helm status ${env.JOB_NAME}-${env.BUILD_NUMBER}", returnStatus: true | ||
if (!result) { | ||
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}" | ||
} | ||
throw exc | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
tests/milvus-java-test/ci/jenkinsfile/deploy_server.groovy
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,16 @@ | ||
try { | ||
sh 'helm init --client-only --skip-refresh --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts' | ||
sh 'helm repo add milvus https://registry.zilliz.com/chartrepo/milvus' | ||
sh 'helm repo update' | ||
dir ("milvus-helm") { | ||
checkout([$class: 'GitSCM', branches: [[name: "${HELM_BRANCH}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${params.GIT_USER}", url: "git@192.168.1.105:megasearch/milvus-helm.git", name: 'origin', refspec: "+refs/heads/${HELM_BRANCH}:refs/remotes/origin/${HELM_BRANCH}"]]]) | ||
dir ("milvus/milvus-gpu") { | ||
sh "helm install --wait --timeout 300 --set engine.image.tag=${IMAGE_TAG} --set expose.type=clusterIP --name ${env.JOB_NAME}-${env.BUILD_NUMBER} -f ci/values.yaml --namespace milvus-sdk-test --version 0.3.1 ." | ||
} | ||
} | ||
} catch (exc) { | ||
echo 'Helm running failed!' | ||
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}" | ||
throw exc | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
tests/milvus-java-test/ci/jenkinsfile/integration_test.groovy
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,13 @@ | ||
timeout(time: 30, unit: 'MINUTES') { | ||
try { | ||
dir ("milvus-java-test") { | ||
sh "mvn clean install" | ||
sh "java -cp \"target/MilvusSDkJavaTest-1.0-SNAPSHOT.jar:lib/*\" com.MainClass -h ${env.JOB_NAME}-${env.BUILD_NUMBER}-milvus-gpu-engine.milvus-sdk-test.svc.cluster.local" | ||
} | ||
|
||
} catch (exc) { | ||
echo 'Milvus-SDK-Java Integration Test Failed !' | ||
throw exc | ||
} | ||
} | ||
|
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,15 @@ | ||
def notify() { | ||
if (!currentBuild.resultIsBetterOrEqualTo('SUCCESS')) { | ||
// Send an email only if the build status has changed from green/unstable to red | ||
emailext subject: '$DEFAULT_SUBJECT', | ||
body: '$DEFAULT_CONTENT', | ||
recipientProviders: [ | ||
[$class: 'DevelopersRecipientProvider'], | ||
[$class: 'RequesterRecipientProvider'] | ||
], | ||
replyTo: '$DEFAULT_REPLYTO', | ||
to: '$DEFAULT_RECIPIENTS' | ||
} | ||
} | ||
return this | ||
|
13 changes: 13 additions & 0 deletions
13
tests/milvus-java-test/ci/jenkinsfile/upload_unit_test_out.groovy
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,13 @@ | ||
timeout(time: 5, unit: 'MINUTES') { | ||
dir ("${PROJECT_NAME}_test") { | ||
if (fileExists('test_out')) { | ||
def fileTransfer = load "${env.WORKSPACE}/ci/function/file_transfer.groovy" | ||
fileTransfer.FileTransfer("test_out/", "${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}", 'nas storage') | ||
if (currentBuild.resultIsBetterOrEqualTo('SUCCESS')) { | ||
echo "Milvus Dev Test Out Viewer \"ftp://192.168.1.126/data/${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}\"" | ||
} | ||
} else { | ||
error("Milvus Dev Test Out directory don't exists!") | ||
} | ||
} | ||
} |
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,110 @@ | ||
pipeline { | ||
agent none | ||
|
||
options { | ||
timestamps() | ||
} | ||
|
||
environment { | ||
SRC_BRANCH = "master" | ||
IMAGE_TAG = "${params.IMAGE_TAG}-release" | ||
HELM_BRANCH = "${params.IMAGE_TAG}" | ||
TEST_URL = "git@192.168.1.105:Test/milvus-java-test.git" | ||
TEST_BRANCH = "${params.IMAGE_TAG}" | ||
} | ||
|
||
stages { | ||
stage("Setup env") { | ||
agent { | ||
kubernetes { | ||
label 'dev-test' | ||
defaultContainer 'jnlp' | ||
yaml """ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
app: milvus | ||
componet: test | ||
spec: | ||
containers: | ||
- name: milvus-testframework-java | ||
image: registry.zilliz.com/milvus/milvus-java-test:v0.1 | ||
command: | ||
- cat | ||
tty: true | ||
volumeMounts: | ||
- name: kubeconf | ||
mountPath: /root/.kube/ | ||
readOnly: true | ||
volumes: | ||
- name: kubeconf | ||
secret: | ||
secretName: test-cluster-config | ||
""" | ||
} | ||
} | ||
|
||
stages { | ||
stage("Deploy Server") { | ||
steps { | ||
gitlabCommitStatus(name: 'Deloy Server') { | ||
container('milvus-testframework-java') { | ||
script { | ||
load "${env.WORKSPACE}/milvus-java-test/ci/jenkinsfile/deploy_server.groovy" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage("Integration Test") { | ||
steps { | ||
gitlabCommitStatus(name: 'Integration Test') { | ||
container('milvus-testframework-java') { | ||
script { | ||
print "In integration test stage" | ||
load "${env.WORKSPACE}/milvus-java-test/ci/jenkinsfile/integration_test.groovy" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage ("Cleanup Env") { | ||
steps { | ||
gitlabCommitStatus(name: 'Cleanup Env') { | ||
container('milvus-testframework-java') { | ||
script { | ||
load "${env.WORKSPACE}/milvus-java-test/ci/jenkinsfile/cleanup.groovy" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
container('milvus-testframework-java') { | ||
script { | ||
load "${env.WORKSPACE}/milvus-java-test/ci/jenkinsfile/cleanup.groovy" | ||
} | ||
} | ||
} | ||
success { | ||
script { | ||
echo "Milvus java-sdk test success !" | ||
} | ||
} | ||
aborted { | ||
script { | ||
echo "Milvus java-sdk test aborted !" | ||
} | ||
} | ||
failure { | ||
script { | ||
echo "Milvus java-sdk test failed !" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/milvus-java-test/ci/pod_containers/milvus-testframework.yaml
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,13 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
app: milvus | ||
componet: testframework-java | ||
spec: | ||
containers: | ||
- name: milvus-testframework-java | ||
image: maven:3.6.2-jdk-8 | ||
command: | ||
- cat | ||
tty: true |
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,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4" /> |
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,137 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>milvus</groupId> | ||
<artifactId>MilvusSDkJavaTest</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-dependencies</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>lib</outputDirectory> | ||
<overWriteReleases>false</overWriteReleases> | ||
<overWriteSnapshots>true</overWriteSnapshots> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<grpc.version>1.23.0</grpc.version><!-- CURRENT_GRPC_VERSION --> | ||
<protobuf.version>3.9.0</protobuf.version> | ||
<protoc.version>3.9.0</protoc.version> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<!-- <dependencyManagement>--> | ||
<!-- <dependencies>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.grpc</groupId>--> | ||
<!-- <artifactId>grpc-bom</artifactId>--> | ||
<!-- <version>${grpc.version}</version>--> | ||
<!-- <type>pom</type>--> | ||
<!-- <scope>import</scope>--> | ||
<!-- </dependency>--> | ||
<!-- </dependencies>--> | ||
<!-- </dependencyManagement>--> | ||
|
||
<repositories> | ||
<repository> | ||
<id>oss.sonatype.org-snapshot</id> | ||
<url>http://oss.sonatype.org/content/repositories/snapshots</url> | ||
<releases> | ||
<enabled>false</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
<version>3.4</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>commons-cli</groupId> | ||
<artifactId>commons-cli</artifactId> | ||
<version>1.3</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<version>6.10</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.9</version> | ||
</dependency> | ||
|
||
<!-- <dependency>--> | ||
<!-- <groupId>io.milvus</groupId>--> | ||
<!-- <artifactId>milvus-sdk-java</artifactId>--> | ||
<!-- <version>0.1.0</version>--> | ||
<!-- </dependency>--> | ||
|
||
<dependency> | ||
<groupId>io.milvus</groupId> | ||
<artifactId>milvus-sdk-java</artifactId> | ||
<version>0.1.1-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<!-- <dependency>--> | ||
<!-- <groupId>io.grpc</groupId>--> | ||
<!-- <artifactId>grpc-netty-shaded</artifactId>--> | ||
<!-- <scope>runtime</scope>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.grpc</groupId>--> | ||
<!-- <artifactId>grpc-protobuf</artifactId>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.grpc</groupId>--> | ||
<!-- <artifactId>grpc-stub</artifactId>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>javax.annotation</groupId>--> | ||
<!-- <artifactId>javax.annotation-api</artifactId>--> | ||
<!-- <version>1.2</version>--> | ||
<!-- <scope>provided</scope> <!– not needed at runtime –>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.grpc</groupId>--> | ||
<!-- <artifactId>grpc-testing</artifactId>--> | ||
<!-- <scope>test</scope>--> | ||
<!-- </dependency>--> | ||
<!-- <dependency>--> | ||
<!-- <groupId>com.google.protobuf</groupId>--> | ||
<!-- <artifactId>protobuf-java-util</artifactId>--> | ||
<!-- <version>${protobuf.version}</version>--> | ||
<!-- </dependency>--> | ||
|
||
</dependencies> | ||
|
||
</project> |
Oops, something went wrong.