Remove load tests jobs (#18429)
parent
60aa069746
commit
8f7083b1d2
|
|
@ -1,181 +0,0 @@
|
|||
pipeline {
|
||||
agent { label 'rhel7-8gb' }
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
timeout(time: 10, unit: 'HOURS')
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '',
|
||||
artifactNumToKeepStr: '', daysToKeepStr: '60', numToKeepStr: '30'))
|
||||
}
|
||||
|
||||
parameters {
|
||||
string(name: 'cheClusterUrl',
|
||||
defaultValue: '',
|
||||
description: 'URL to the cluster where CHE is running.')
|
||||
|
||||
string(name: 'cheClusterUsername',
|
||||
defaultValue: '',
|
||||
description: 'Username for login to the cluster where CHE is runing.')
|
||||
|
||||
password(name: 'cheClusterPassword',
|
||||
defaultValue: '',
|
||||
description: 'Password for login to the cluster where CHE is running.')
|
||||
|
||||
string(name: 'serverLabel',
|
||||
defaultValue: 'che',
|
||||
description: 'Label for server pod.')
|
||||
|
||||
string(name: 'testClusterUrl',
|
||||
defaultValue: '',
|
||||
description: 'URL to the cluster where CHE should run.')
|
||||
|
||||
string(name: 'testClusterUsername',
|
||||
defaultValue: '',
|
||||
description: 'Username for login to the cluster where tests will be runing.')
|
||||
|
||||
password(name: 'testClusterPassword',
|
||||
defaultValue: '',
|
||||
description: 'Password for login to the cluster where tests will be running.')
|
||||
|
||||
string(name: 'cheClusterNamespace',
|
||||
defaultValue: '',
|
||||
description: 'Namespace where CHE is running.')
|
||||
|
||||
string(name: 'testClusterNamespace',
|
||||
defaultValue: '',
|
||||
description: 'Namespace where tests will be running.')
|
||||
|
||||
string(name: 'numberOfUsers',
|
||||
defaultValue: '',
|
||||
description: 'Number of users for load tests.')
|
||||
|
||||
string(name: 'numberOfRepetitions',
|
||||
defaultValue: '',
|
||||
description: 'Number of workspaces that should be run by one user (in serial maneur).')
|
||||
|
||||
string(name: 'testingImage',
|
||||
defaultValue: '',
|
||||
description: 'Image with tests.')
|
||||
|
||||
string(name: 'repoWithScripts',
|
||||
defaultValue: 'https://github.com/eclipse/che.git',
|
||||
description: 'Github repo with load tests scripts.')
|
||||
|
||||
string(name: 'pathToScripts',
|
||||
defaultValue: 'che/tests/performance',
|
||||
description: 'Path to scripts within the repo.')
|
||||
|
||||
string(name: 'logLevel',
|
||||
defaultValue: 'TRACE',
|
||||
description: 'Log level for tests running in image.')
|
||||
|
||||
}
|
||||
environment {
|
||||
OC_PATH="/tmp"
|
||||
PATH= "$PATH:$OC_PATH"
|
||||
|
||||
shmSize = "4096m"
|
||||
loadPageTimeout = 240000
|
||||
startWorkspaceTimeout = 900000
|
||||
workspaceStatusPolling = 20000
|
||||
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Preset environment') {
|
||||
steps {
|
||||
script {
|
||||
sh """
|
||||
set +x
|
||||
echo "Installing oc..."
|
||||
wget -q https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.3.1/openshift-client-linux-4.3.1.tar.gz -O - | tar -xz
|
||||
mv oc $OC_PATH
|
||||
echo "Setting CHE context..."
|
||||
oc login $cheClusterUrl -u $cheClusterUsername -p $cheClusterPassword --insecure-skip-tls-verify
|
||||
oc project $cheClusterNamespace
|
||||
"""
|
||||
|
||||
env.CHE_CONTEXT = sh (script: "oc whoami -c", returnStdout: true)
|
||||
|
||||
sh """
|
||||
set +x
|
||||
echo "Setting test context..."
|
||||
oc login $testClusterUrl -u $testClusterUsername -p $testClusterPassword --insecure-skip-tls-verify
|
||||
set +e
|
||||
project=`oc get projects | grep $testClusterNamespace`
|
||||
if [[ -z \$project ]]; then oc new-project $testClusterNamespace; fi
|
||||
set -e
|
||||
oc project $testClusterNamespace;
|
||||
"""
|
||||
|
||||
env.TEST_CONTEXT = sh (script: "oc whoami -c", returnStdout: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Clone upstream che") {
|
||||
steps {
|
||||
sh"""
|
||||
echo "Clone che"
|
||||
git clone $repoWithScripts
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage('Run load tests') {
|
||||
parallel {
|
||||
stage('Gather server logs') {
|
||||
steps {
|
||||
script {
|
||||
sh """
|
||||
set +x
|
||||
touch server-logs.txt
|
||||
|
||||
oc config use-context ${env.CHE_CONTEXT}
|
||||
oc logs -f \$(oc get pods -l app=$serverLabel,component=$serverLabel -o name) >> server-logs.txt || echo "Process gathering logs was killed."
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Run test scripts') {
|
||||
steps {
|
||||
script {
|
||||
sh """
|
||||
set +x
|
||||
ROOT=`pwd`
|
||||
cd $pathToScripts
|
||||
|
||||
oc config use-context ${env.CHE_CONTEXT}
|
||||
checlusterName=`oc get checluster -o jsonpath='{.items[].metadata.name}'`
|
||||
CHE_URL=`oc get checluster \$checlusterName -o jsonpath='{.status.cheURL}'`
|
||||
|
||||
mkdir \$ROOT/report/
|
||||
oc config use-context ${env.TEST_CONTEXT}
|
||||
./load-tests.sh -u user -p load-user -n $numberOfUsers -i $testingImage -r \$CHE_URL -f \$ROOT/report -t $numberOfRepetitions -l $logLevel
|
||||
"""
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
sh """
|
||||
set +x
|
||||
pId=\$(ps x | grep "oc logs -f" | grep -v "grep" | head -n 1 | awk '{print \$1}')
|
||||
kill \$pId
|
||||
|
||||
ROOT=`pwd`
|
||||
cp server-logs.txt \$ROOT/report
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
archiveArtifacts artifacts: "report/**"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
pipeline {
|
||||
agent { label 'rhel7-8gb' }
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
timeout(time: 1, unit: 'HOURS')
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '',
|
||||
artifactNumToKeepStr: '', daysToKeepStr: '60', numToKeepStr: '30'))
|
||||
}
|
||||
|
||||
parameters {
|
||||
string(name: 'cheClusterUrl',
|
||||
defaultValue: '',
|
||||
description: 'URL to the cluster where CHE is running.')
|
||||
|
||||
string(name: 'cheClusterUsername',
|
||||
defaultValue: '',
|
||||
description: 'Username for login to the cluster where CHE is runing.')
|
||||
|
||||
password(name: 'cheClusterPassword',
|
||||
defaultValue: '',
|
||||
description: 'Password for login to the cluster where CHE is running.')
|
||||
|
||||
string(name: 'cheClusterNamespace',
|
||||
defaultValue: '',
|
||||
description: 'Namespace where CHE is running.')
|
||||
|
||||
string(name: 'numberOfUsers',
|
||||
defaultValue: '',
|
||||
description: 'Number of users that should be created.')
|
||||
|
||||
string(name: 'startingIndex',
|
||||
defaultValue: '1',
|
||||
description: 'Startnig index for user creation. If you don\'t have any user created yet, set 1.')
|
||||
|
||||
choice(name: 'environment',
|
||||
choices: ['Che', 'CRW'],
|
||||
description: 'Environment, where users should be created. Can be Che or CRW.')
|
||||
|
||||
string(name: 'keycloakAdminUsername',
|
||||
defaultValue: 'admin',
|
||||
description: 'Keycloak admin username, default to "admin".')
|
||||
|
||||
password(name: 'keycloakAdminPassword',
|
||||
defaultValue: 'admin',
|
||||
description: 'Keacloak admin password, deafult to "admin".')
|
||||
|
||||
}
|
||||
environment {
|
||||
OC_PATH="/tmp"
|
||||
PATH= "$PATH:$OC_PATH"
|
||||
|
||||
USERNAME_BASE="user"
|
||||
USERNAME_PASS="load-user"
|
||||
PATH_TO_SCRIPTS="che/tests/performance"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Preset environment') {
|
||||
steps {
|
||||
script {
|
||||
sh """
|
||||
set +x
|
||||
echo "Installing oc..."
|
||||
wget -q https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.3.1/openshift-client-linux-4.3.1.tar.gz -O - | tar -xz
|
||||
mv oc $OC_PATH
|
||||
echo "Setting CHE context..."
|
||||
oc login $cheClusterUrl -u $cheClusterUsername -p $cheClusterPassword --insecure-skip-tls-verify
|
||||
oc project $cheClusterNamespace
|
||||
"""
|
||||
|
||||
env.CHE_CONTEXT = sh (script: "oc whoami -c", returnStdout: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Clone upstream che") {
|
||||
steps {
|
||||
sh"""
|
||||
echo "Clone che"
|
||||
git clone https://github.com/eclipse/che.git
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage('Create users') {
|
||||
steps {
|
||||
sh """
|
||||
cd $PATH_TO_SCRIPTS
|
||||
oc config use-context ${env.CHE_CONTEXT}
|
||||
./create_users.sh -n $USERNAME_BASE -m $USERNAME_PASS -s $startingIndex -c $numberOfUsers -e $environment -a $keycloakAdminUsername -p $keycloakAdminPassword
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue