Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #32 from splunk/test/common-versioning-changes
Browse files Browse the repository at this point in the history
common versioning changes
  • Loading branch information
zahrasidhpuri-crest authored Jan 19, 2021
2 parents 4f48836 + 477febf commit 743f64b
Show file tree
Hide file tree
Showing 27 changed files with 907 additions and 2,025 deletions.
812 changes: 473 additions & 339 deletions .circleci/config.yml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "CLA Assistant"
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
CLAssistant:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
# Alpha Release
uses: cla-assistant/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
PERSONAL_ACCESS_TOKEN: ${{ secrets.PAT_CLATOOL }}
with:
path-to-signatures: ".github/signatures/version1/cla.json"
path-to-document: "https://github.com/splunk/addonfactory-test-releaseci/blob/main/CLA.md" # e.g. a CLA or a DCO document
# branch should not be protected
branch: "master"
allowlist: dependabot
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
#signed-commit-messag e: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
21 changes: 21 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release-Notes-Preview

on:
pull_request:
branches: [master, develop]
issue_comment:
types: [edited]

jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git fetch --unshallow --tags
- uses: snyk/[email protected]
with:
releaseBranch: master
env:
GITHUB_PR_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ tests/functional
.DS_Store
.env
src

*.lock
*_event
*_wait
!deps/build
!package/appserver/static/js/build
*.log
*.lock
*_events
*.log
14 changes: 14 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
branches:
- "+([0-9])?(.{+([0-9]),x}).x"
- master
- name: develop
channel: beta
prerelease: true
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- - "@semantic-release/github"
- assets:
- /tmp/workspace/build/package/splunkbase/*
- /tmp/workspace/build/package/deployment/*
23 changes: 23 additions & 0 deletions Dockerfile-http_proxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM sameersbn/squid:3.5.27-2
ARG PROXY_USERNAME=user1
ARG PROXY_PASSWORD=123456
RUN apt-get update
RUN apt-get install -y apache2-utils
RUN touch /etc/squid/passwords
RUN chmod 777 /etc/squid/passwords
RUN htpasswd -b /etc/squid/passwords $PROXY_USERNAME $PROXY_PASSWORD
RUN mv /etc/squid/squid.conf /etc/squid/squid.conf.original
RUN echo "auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords\n"\
"auth_param basic realm Squid proxy-caching web server\n"\
"auth_param basic credentialsttl 24 hours\n"\
"auth_param basic casesensitive off\n"\
"acl authenticated proxy_auth REQUIRED\n"\
"http_access allow authenticated\n"\
"http_access deny all\n"\
"dns_v4_first on\n"\
"forwarded_for delete\n"\
"via off\n"\
"http_port 3128\n" > /etc/squid/squid.conf
RUN cat /etc/squid/squid.conf
RUN service squid start
RUN service squid restart
12 changes: 12 additions & 0 deletions Dockerfile-saucelabs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#Splunk Connect for Syslog (SC4S) by Splunk, Inc.
#
#To the extent possible under law, the person who associated CC0 with
#Splunk Connect for Syslog (SC4S) has waived all copyright and related or neighboring rights
#to Splunk Connect for Syslog (SC4S).
#
#You should have received a copy of the CC0 legalcode along with this
#work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
FROM circleci/python:3.7
RUN curl https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz -o /home/circleci/saucelabs.tar.gz
RUN tar -xzf /home/circleci/saucelabs.tar.gz --directory /home/circleci/
CMD /home/circleci/sc-4.6.2-linux/bin/sc -u $SAUCE_USERNAME -k $SAUCE_PASSWORD -i $SAUCE_TUNNEL_ID --no-remove-colliding-tunnels -v --se-port 4445
10 changes: 8 additions & 2 deletions Dockerfile-splunk
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ ARG SPLUNK_VERSION=latest
FROM splunk/splunk:$SPLUNK_VERSION
ARG SPLUNK_VERSION=latest
ARG SPLUNK_APP_ID=TA_UNKNOWN
ARG SPLUNK_APP_PACKAGE=package
ARG SPLUNK_APP_PACKAGE=$SPLUNK_APP_PACKAGE
RUN echo Splunk VERSION=$SPLUNK_VERSION

COPY deps/apps /opt/splunk/etc/apps/
COPY deps/apps/splunk-add-on-for-modinput-test/output /opt/splunk/etc/apps/
COPY deps/build/addonfactory_test_matrix_splunk/packages/all/common /opt/splunk/etc/apps/
COPY deps/build/addonfactory_test_matrix_splunk/packages/all/sh /opt/splunk/etc/apps/
COPY deps/build/addonfactory_test_matrix_splunk/packages/all/addon_factory_web /opt/splunk/etc/system/local
COPY $SPLUNK_APP_PACKAGE /opt/splunk/etc/apps/$SPLUNK_APP_ID

COPY $SPLUNK_APP_PACKAGE /opt/splunk/etc/apps/$SPLUNK_APP_ID
COPY .pytest.expect /home/circleci/work_backend/.pytest.expect
COPY tests /home/circleci/work_backend/tests
31 changes: 21 additions & 10 deletions Dockerfile-tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,29 @@
#
#You should have received a copy of the CC0 legalcode along with this
#work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
FROM python:3.7

RUN mkdir -p /work/tests
RUN mkdir -p /work/test-results/functional
ARG IMAGE_TAG=3.7-browsers
FROM circleci/python:$IMAGE_TAG
RUN mkdir -p /home/circleci/work/tests
RUN mkdir -p /home/circleci/work/test-results/functional

COPY tests/entrypoint.sh /
COPY tests/pytest-ci.ini /work/pytest.ini
COPY .pytest.expect /work/.pytest.expect
COPY .pytest.expect /home/circleci/work/.pytest.expect
COPY requirements_dev.txt /home/circleci/work/
COPY requirements_py2_dev.txt /home/circleci/work/
COPY requirements_addon_specific.txt /home/circleci/work/
COPY tests /home/circleci/work/tests
RUN cd /home/circleci/work/tests && ls

COPY tests /work/tests
RUN pip install -r /work/tests/requirements.txt
COPY package /work/package
RUN cd ../..
COPY package /home/circleci/work/package
COPY output /home/circleci/work/output
RUN sudo chown -R circleci /home/circleci/

CMD /entrypoint.sh
# Below three lines are added to create specific path required by splunktalib to create log file.
# Once fix is avalible(ADDON-32060) in splunktalib, remove these lines.
USER root
RUN mkdir -p /opt/splunk/var/log/splunk
RUN chmod -R 777 /opt/splunk/var/log/splunk

USER circleci
ENTRYPOINT /entrypoint.sh
80 changes: 77 additions & 3 deletions docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,41 @@ version: "3.7"

services:
test:
environment:
- SAUCE_USERNAME=${SAUCE_USERNAME}
- SAUCE_PASSWORD=${SAUCE_PASSWORD}
- TEST_SET=${TEST_SET}
- TEST_TYPE=${TEST_TYPE}
- JOB_NAME=${JOB_NAME}
- SAUCE_TUNNEL_ID=${SAUCE_IDENTIFIER}
- SAUCE_TUNNEL_PARENT=none
- UI_TEST_HEADLESS=${UI_TEST_HEADLESS}
- RERUN_COUNT=${RERUN_COUNT}
- TEST_BROWSER=${TEST_BROWSER}
- RP_ENDPOINT=${RP_ENDPOINT}
- RP_UUID=${RP_UUID}
- RP_LAUNCH_ATTRIBUTES=${RP_LAUNCH_ATTRIBUTES}
- RP_PROJECT=${RP_PROJECT}
- RP_LAUNCH=${RP_LAUNCH}
- RP_LAUNCH_DESC=${RP_LAUNCH_DESC}
- IMAGE_TAG=${IMAGE_TAG}
env_file:
- test_credentials.env
build:
context: .
dockerfile: Dockerfile-tests
args:
IMAGE_TAG: ${IMAGE_TAG}
links:
- splunk
- sc4s
- http_proxy
- socks5
volumes:
- results:/work/test-results
- results:/home/circleci/work

sc4s:
image: splunk/scs:latest
image: splunk/scs:${SC4S_VERSION}
hostname: sc4s
#When this is enabled test_common will fail
# command: -det
Expand Down Expand Up @@ -53,13 +77,25 @@ services:
- SC4S_ARCHIVE_GLOBAL=no
- SC4S_LISTEN_CHECKPOINT_SPLUNK_NOISE_CONTROL=yes

socks5:
image: serjs/go-socks5-proxy:latest
hostname: socks5
ports:
- "1080"
stdin_open: true
tty: true
links:
- splunk
environment:
- PROXY_USER=splunk_socks5
- PROXY_PASSWORD=splunk_socks5
splunk:
build:
context: .
dockerfile: Dockerfile-splunk
args:
SPLUNK_APP_ID: ${SPLUNK_APP_ID}
SPLUNK_APP_PACKAGE: package
SPLUNK_APP_PACKAGE: ${SPLUNK_APP_PACKAGE}
SPLUNK_VERSION: ${SPLUNK_VERSION}
hostname: splunk
ports:
Expand All @@ -71,7 +107,45 @@ services:
- SPLUNK_PASSWORD=Chang3d!
- SPLUNK_START_ARGS=--accept-license
- SPLUNK_HEC_TOKEN=9b741d03-43e9-4164-908b-e09102327d22
- TEST_SET=${TEST_SET}
- RP_ENDPOINT=${RP_ENDPOINT}
- RP_UUID=${RP_UUID}
- RP_LAUNCH_ATTRIBUTES=${RP_LAUNCH_ATTRIBUTES}
- RP_PROJECT=${RP_PROJECT}
- RP_LAUNCH=${RP_LAUNCH}
- RP_LAUNCH_DESC=${RP_LAUNCH_DESC}
env_file:
- test_credentials.env
volumes:
- backend_results:/home/circleci/work_backend

sauceconnect:
build:
context: .
dockerfile: Dockerfile-saucelabs
environment:
- SAUCE_USERNAME=${SAUCE_USERNAME}
- SAUCE_PASSWORD=${SAUCE_PASSWORD}
- SAUCE_TUNNEL_ID=${SAUCE_IDENTIFIER}
- SAUCE_TUNNEL_PARENT=none
hostname: sauceconnect
ports:
- "4445"
http_proxy:
build:
context: .
dockerfile: Dockerfile-http_proxy
hostname: http_proxy
ports:
- "3128"
stdin_open: true
environment:
- PROXY_USERNAME=user1
- PROXY_PASSWORD=123456
tty: true

volumes:
results:
external: false
backend_results:
external: false
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ services:
environment:
- SPLUNK_PASSWORD=${SPLUNK_PASSWORD}
- SPLUNK_HEC_TOKEN=${SPLUNK_HEC_TOKEN}
- SPLUNK_START_ARGS=--accept-license
- SPLUNK_START_ARGS=--accept-license
5 changes: 5 additions & 0 deletions requirements_addon_specific.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##
## SPDX-FileCopyrightText: 2020 Splunk, Inc. <[email protected]>
## SPDX-License-Identifier: LicenseRef-Splunk-1-2020
##
## Requirements Specific to the Addon for Testing
23 changes: 20 additions & 3 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
## SPDX-FileCopyrightText: 2020 Splunk, Inc. <[email protected]>
## SPDX-License-Identifier: LicenseRef-Splunk-1-2020
##
-r tests/requirements.txt
pip install lovely-pytest-docker
reuse
## Addon Requirements for Testing
https://712-287085785-gh.circle-artifacts.com/0/dist/splunk_add_on_ucc_framework-4.1.12.post5.dev0%2B99f91870.tar.gz
lovely-pytest-docker==0.2.0
reuse==0.12.1
pytest==6.2.1
https://download.splunk.com/misc/packaging-toolkit/splunk-packaging-toolkit-1.0.1.tar.gz
pytest-xdist==2.2.0
pytest-ordering==0.6
pytest-splunk-addon==1.4.0
pytest-expect==1.1.0
pytest-splunk-addon-ui-smartx==1.1.0
pytest-rerunfailures==9.1.1
mock==3.0.5
requests==2.25.1
u-msgpack-python==2.5.0
six==1.12.0
coverage==4.0.3
splunk-sdk==1.6.14
future==0.18.2
-r requirements_addon_specific.txt
10 changes: 10 additions & 0 deletions requirements_py2_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
##
## SPDX-FileCopyrightText: 2020 Splunk, Inc. <[email protected]>
## SPDX-License-Identifier: LicenseRef-Splunk-1-2020
##
## Python2 Addon Requirements for Testing
lovely-pytest-docker
pytest
pytest-xdist
pytest-expect
mock==3.0.5
6 changes: 6 additions & 0 deletions test_credentials.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
##
## SPDX-FileCopyrightText: 2020 Splunk, Inc. <[email protected]>
## SPDX-License-Identifier: LicenseRef-Splunk-1-2020
##
##
# Add Addon specific Environment variables in this file. Variables must be set in CircleCI Environment."
5 changes: 0 additions & 5 deletions tests/__init__.py

This file was deleted.

Loading

0 comments on commit 743f64b

Please sign in to comment.