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
75 changes: 74 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,22 @@ workflows:
- unit-tests
- vulnerability-scan:
requires:
- build-image
- build-image
monitoring-console-integration-test:
jobs:
- build-image
- unit-tests
- monitoring-console-tests:
requires:
- build-image
- unit-tests
filters:
branches:
only:
- feature-MC/CRD
- integration-tests:
requires:
- monitoring-console-tests
build-and-push:
jobs:
- build-image
Expand Down Expand Up @@ -435,3 +450,61 @@ jobs:
command: |
make cluster-down
no_output_timeout: 30m
# Runs integration tests against a k8s cluster
monitoring-console-tests:
executor: ubuntu-machine
steps:
- run:
name: Setup Splunk operator and enterprise image env vars
command: |
echo 'export SPLUNK_OPERATOR_IMAGE=${IMAGE_NAME}:${CIRCLE_SHA1}' >> $BASH_ENV
echo 'export SPLUNK_ENTERPRISE_IMAGE=${ENTERPRISE_IMAGE_NAME}' >> $BASH_ENV
echo 'export COMMIT_HASH=$(echo ${CIRCLE_SHA1:0:7})' >> $BASH_ENV
- kubernetes/install
- aws-cli/install
- aws-eks/install-eksctl
- run:
name: Install kind tool
command: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.7.0/kind-$(uname)-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin
- checkout
- attach_workspace:
name: Restore workspace
at: /tmp
# load the operator image to local registry in the VM
- load_image
- run:
name: Print out version and environment
command: |
ls -al
echo "GO VERSION=`go version`"
echo "CIRCLE_SHA1=$CIRCLE_SHA1"
echo "SPLUNK_OPERATOR_IMAGE=$SPLUNK_OPERATOR_IMAGE"
echo "SPLUNK_ENTEPRISE_IMAGE=$SPLUNK_ENTERPRISE_IMAGE"
echo "PRIVATE_REGISTRY=$PRIVATE_REGISTRY"
echo "CLUSTER_PROVIDER=$CLUSTER_PROVIDER"
- run:
# Deploys a eks or kind cluster depending of CLUSTER_PROVIDER flag. If cluster already exists,
# it will skip. Uses NUM_WORKERS for size of cluster
name: Deploy k8s cluster
command: |
make cluster-up
kubectl version # log the k8s version
no_output_timeout: 30m
- run:
# Run the integration tests againsts the cluster deployed above.
# Test againsts the SPLUNK_OPERATOR_IMAGE and SPLUNK_ENTERPRISE_IMAGE
name: Run integration tests
command: |
make int-test
mkdir -p /tmp/test-results
find ./test -name "*junit.xml" -exec cp {} /tmp/test-results \;
environment:
TEST_FOCUS: "monitoring_console"
- store_test_results:
name: Save test results
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
Loading