Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom pack deps script #101

Merged
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
11 changes: 11 additions & 0 deletions .circle/circle.yml.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# WARNING: Minimize edits to this file!
#
# This file is part of the CI infrastructure for the StackStorm-Exchange.
# As such, it gets overwritten periodically in CI infrastructure updates.
# Check out `tests/setup_testing_env.sh` for how to customize the test env.
# If you need to add jobs, docker images, or other changes that do not work
# in `tests/setup_testing_env.sh`, then please add what you need and avoid
# changing the standard build_and_test and deploy jobs.
#
# Thanks for your contribution!
---
version: 2

jobs:
Expand Down
8 changes: 8 additions & 0 deletions .circle/dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ echo "Installing StackStorm runners and registering metrics drivers"
if [[ -n "${ROOT_DIR}" ]]; then
PACK_REQUIREMENTS_FILE="${ROOT_DIR}/requirements.txt"
PACK_TESTS_REQUIREMENTS_FILE="${ROOT_DIR}/requirements-tests.txt"
PACK_SETUP_TESTING_ENV="${ROOT_DIR}/tests/setup_testing_env.sh"

echo "Copying Makefile to ${ROOT_DIR}"
cp ~/ci/.circle/Makefile ${ROOT_DIR}
make -C requirements-ci .install-runners
else
PACK_REQUIREMENTS_FILE="$(pwd)/requirements.txt"
PACK_TESTS_REQUIREMENTS_FILE="$(pwd)/requirements-tests.txt"
PACK_SETUP_TESTING_ENV="$(pwd)/tests/setup_testing_env.sh"

echo "Copying Makefile to $(pwd)"
cp ~/ci/.circle/Makefile .
Expand All @@ -73,5 +75,11 @@ if [[ -f "${PACK_TESTS_REQUIREMENTS_FILE}" ]]; then
~/virtualenv/bin/pip install -r "${PACK_TESTS_REQUIREMENTS_FILE}"
fi

# Install custom pack testing enviornment
if [[ -x "${PACK_SETUP_TESTING_ENV}" ]]; then
echo "Setting up custom pack testing environment with ${PACK_SETUP_TESTING_ENV}"
"${PACK_SETUP_TESTING_ENV}"
fi

echo "Installed dependencies:"
pip list
15 changes: 15 additions & 0 deletions .circle/setup_testing_env.sh.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# For python deps, please use requirements.txt or requirements-test.txt.
# Do not install python requirements with this script.

# Some packs need to install and configure additional packages to properly
# run their test suite. Other packs need to clone other repositories to
# reuse standardized testing infrastructure. And other functional or end-to-end
# tests might need additional system setup to access external APIs via
# an enterprise bus or something else.
# That is the purpose of this script. Setup the testing environment
# to do mock-less regression or end-to-end testing.

# This script is called by `deployment` housed in StackStorm-exchange/ci.
# `deployment` will only run this script if it is executable.
5 changes: 5 additions & 0 deletions utils/exchange-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ git add .circleci/config.yml
curl -sS --fail "https://raw.githubusercontent.com/StackStorm-Exchange/ci/master/files/.gitignore.sample" > .gitignore
git add .gitignore

mkdir tests
curl -sS --fail "https://raw.githubusercontent.com/StackStorm-Exchange/ci/master/.circle/setup_testing_env.sh.sample" > tests/setup_testing_env.sh
# no execute bit until pack-author enables it.
git add tests/setup_testing_env.sh

git commit -m "Bootstrap a StackStorm Exchange pack repository for pack ${PACK}."
git push origin master

Expand Down