Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .github/workflows/e2e_tests.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/release.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/run_tests.yaml

This file was deleted.

108 changes: 108 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
pipeline {
agent any

libraries {
lib('fm-shared-library@main')
}//end libraries. Github Repo: https://github.com/rollout/fm-cbci-shared-library

options {
timeout(time: 45, unit: 'MINUTES')
}//end options

environment {
PATH = "/usr/local/go/bin:${env.PATH}"
}

stages {
stage('Checkout') {
steps {
checkout scm
}
}

stage("Run Unit tests"){
agent {
kubernetes {
inheritFrom 'golang'
yamlFile './cbci-templates/fmforci.yaml'
}
}

steps {
container(name: "server", shell: "sh") {
withCredentials([
sshUserPrivateKey(credentialsId: 'SDK_E2E_SSH_KEY', keyFileVariable: 'SDK_E2E_SSH_KEY', passphraseVariable: '', usernameVariable: 'cloudbees.eslint@cloudbees.com'),
]) {
echo "Executing Run tests"
sh script: 'cd ./v6 && go test ./core/...',
label: "Running unit tests"
}
}
}
post{
success{
echo 'Unit Tests OK; posting results'
}
failure{
echo 'Unit Tests Failed;'
}
}
}

stage("Run E2E tests"){
agent {
kubernetes {
inheritFrom 'default'
yamlFile './cbci-templates/fmforci.yaml'
}
}

when {
branch 'master'
}

steps {
container("rox-proxy") {
waitForRoxProxy()
}

container(name: "server", shell: 'sh') {
withCredentials([
string(credentialsId: 'TEST_E2E_BEARER', variable: 'TEST_E2E_BEARER'),
sshUserPrivateKey(credentialsId: 'SDK_E2E_SSH_KEY', keyFileVariable: 'SDK_E2E_SSH_KEY', passphraseVariable: '', usernameVariable: 'cloudbees.eslint@cloudbees.com'),
sshUserPrivateKey(credentialsId: 'SDK_E2E_TESTS_DEPLOY_KEY', keyFileVariable: 'SDK_E2E_TESTS_DEPLOY_KEY', passphraseVariable: '', usernameVariable: 'cloudbees.eslint@cloudbees.com'),
]) {
script {
addGitHubFingerprint()
TESTENVPARAMS = "QA_E2E_BEARER=$TEST_E2E_BEARER API_HOST=https://api.test.rollout.io CD_API_ENDPOINT=https://api.test.rollout.io/device/get_configuration CD_S3_ENDPOINT=https://rox-conf.test.rollout.io/ SS_API_ENDPOINT=https://api.test.rollout.io/device/update_state_store/ SS_S3_ENDPOINT=https://rox-state.test.rollout.io/ CLIENT_DATA_CACHE_KEY=client_data ANALYTICS_ENDPOINT=https://analytic.test.rollout.io/ NOTIFICATIONS_ENDPOINT=https://push.test.rollout.io/sse"

withEnv(["GIT_SSH_COMMAND=ssh -i ${SDK_E2E_SSH_KEY}"]) {
echo "Executing E2E tests"
sh script: """
apt-get update && apt-get install -y curl gnupg
curl -sL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs && npm install -g yarn

git clone git@github.com:rollout/sdk-end-2-end-tests.git
ln -s ${pwd()}/v6/driver/ ${pwd()}/sdk-end-2-end-tests/drivers/go
cd sdk-end-2-end-tests
yarn install --frozen-lockfile
SDK_LANG=go ${TESTENVPARAMS} NODE_ENV=container yarn test:env
""", label: "Pull SDK end2 tests repository"
}// end withEnv
}
}
}
}
post{
success{
echo 'E2E Tests OK; posting results'
}
failure{
echo 'E2E Tests Failed;'
}

}
}
}
}
29 changes: 29 additions & 0 deletions cbci-templates/fmforci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Pod
metadata:
name: fm-rox-go-sdk
spec:
serviceAccountName: ops-gcr-rw
containers:
- name: server
image: golang:1.18
tty: true
resources:
requests:
memory: "4Gi"
cpu: "2000m"
limits:
memory: "4Gi"
cpu: "2000m"
- name: rox-proxy
image: rollout/simple-proxy
tty: true
ports:
- containerPort: 8080
resources:
requests:
memory: "1Gi"
cpu: "1000m"
limits:
memory: "1Gi"
cpu: "1000m"