Skip to content

Commit 8d85c05

Browse files
authored
Merge pull request #78 from StackStorm-Exchange/force-check
Force check
2 parents e41661d + af6f891 commit 8d85c05

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

.circle/Makefile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ CHANGED_DIRECTORIES := $(shell $(CI_DIR)/utils/git-changes directories)
99
VIRTUALENV_DIR ?= virtualenv
1010
ST2_REPO_PATH ?= /tmp/st2
1111
ST2_REPO_BRANCH ?= master
12-
FORCE_CHECK_ALL_FILES =? false
13-
FORCE_CHECK_PACK =? false
12+
FORCE_CHECK_ALL_FILES ?= false
13+
FORCE_CHECK_PACK ?= false
1414

1515
export ST2_REPO_PATH ROOT_DIR FORCE_CHECK_ALL_FILES FORCE_CHECK_PACK
1616

@@ -68,7 +68,7 @@ compile:
6868
@echo "==================== flake8 ===================="
6969
@echo
7070
. $(VIRTUALENV_DIR)/bin/activate; \
71-
if [ "$${FORCE_CHECK_ALL_FILES}" ]; then \
71+
if [ "$${FORCE_CHECK_ALL_FILES}" = "true" ]; then \
7272
find ./* -name "*.py" | while read py_file; do \
7373
flake8 --config=$(CI_DIR)/lint-configs/python/.flake8 $$py_file || exit 1; \
7474
done; \
@@ -88,7 +88,7 @@ compile:
8888
@echo "==================== pylint ===================="
8989
@echo
9090
. $(VIRTUALENV_DIR)/bin/activate; \
91-
if [ "$${FORCE_CHECK_ALL_FILES}" ] || [ -n "${CHANGED_PY}" ]; then \
91+
if [ "$${FORCE_CHECK_ALL_FILES}" = "true" ] || [ -n "${CHANGED_PY}" ]; then \
9292
REQUIREMENTS_DIR=$(CI_DIR)/.circle/ \
9393
CONFIG_DIR=$(CI_DIR)/lint-configs/ \
9494
st2-check-pylint-pack $(ROOT_DIR) || exit 1; \
@@ -142,11 +142,7 @@ compile:
142142
@echo "==================== example config check ===================="
143143
@echo
144144
. $(VIRTUALENV_DIR)/bin/activate; \
145-
if [ "$${FORCE_CHECK_ALL_FILES}" = "true" ]; then \
146-
find ./* | while read file; do \
147-
st2-check-validate-pack-example-config $$file || exit 1; \
148-
done; \
149-
elif [ -n "${CHANGED_FILES}" ]; then \
145+
if [ "$${FORCE_CHECK_ALL_FILES}" = "true" ] || [ -n "${CHANGED_FILES}" ]; then \
150146
st2-check-validate-pack-example-config /tmp/packs/$(PACK_NAME) || exit 1; \
151147
else \
152148
echo "No files have changed, skipping run..."; \
@@ -170,7 +166,7 @@ compile:
170166
@echo "==================== packs-resource-register ===================="
171167
@echo
172168
. $(VIRTUALENV_DIR)/bin/activate; \
173-
if [ ! "${CHANGED_FILES}" ]; then \
169+
if [ -z "${CHANGED_FILES}" ]; then \
174170
echo "No files have changed, skipping run..."; \
175171
else \
176172
st2-check-register-pack-resources /tmp/packs/$(PACK_NAME) || exit 1; \
@@ -182,7 +178,7 @@ compile:
182178
@echo "==================== packs-tests ===================="
183179
@echo
184180
. $(VIRTUALENV_DIR)/bin/activate; \
185-
if [ ! "${CHANGED_FILES}" ]; then \
181+
if [ -z "${CHANGED_FILES}" ]; then \
186182
echo "No files have changed, skipping run..."; \
187183
else \
188184
$(ST2_REPO_PATH)/st2common/bin/st2-run-pack-tests -c -t -x -j -p $(ROOT_DIR) || exit 1; \
@@ -193,7 +189,7 @@ compile:
193189
@echo
194190
@echo "==================== pack-missing-tests ===================="
195191
@echo
196-
if [ ! "${CHANGED_FILES}" ]; then \
192+
if [ -z "${CHANGED_FILES}" ]; then \
197193
echo "No files have changed, skipping run..."; \
198194
else \
199195
st2-check-print-pack-tests-coverage $(ROOT_DIR) || exit 1; \

.circle/test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ then
1919
exit 1
2020
fi
2121

22-
GIT_BRANCH=$(git for-each-ref --format='%(objectname) %(refname:short)' refs/heads | awk "/^$(git rev-parse HEAD)/ {print \$2}")
23-
PYTHON_VERSION=$(python --version)
22+
GIT_BRANCH=$(git symbolic-ref --short HEAD)
23+
PYTHON_VERSION=$(python --version 2>&1)
2424

2525
# When running on master branch we want to run checks on all the files / packs not only on
2626
# changed ones.

0 commit comments

Comments
 (0)