Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
5a2d17d8
Commit
5a2d17d8
authored
Dec 21, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move travis test scripts into makefiles so that they can be parallelized
parent
deb66ba2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
51 deletions
+60
-51
.travis.yml
+5
-51
Makefile
+6
-0
test.mk
+26
-0
tests/test_edx_east_roles.sh
+23
-0
No files found.
.travis.yml
View file @
5a2d17d8
...
...
@@ -13,55 +13,9 @@ install:
-
"
sudo
apt-get
install
-y
nodejs
python-demjson"
-
"
pip
install
--allow-all-external
-r
requirements.txt"
-
"
pip
install
--allow-all-external
demjson"
env
:
-
MAKE_TARGET=docker.test
-
MAKE_TARGET=test.syntax
-
MAKE_TARGET=test.edx_east_roles
script
:
-
|
for yml in $(find . -name "*.yml"); do
python -c "import sys,yaml; yaml.load(open(sys.argv[1]))" $yml >/dev/null
if [[ $? -ne 0 ]]; then
echo "ERROR parsing $yml"
exit 1
fi
done
-
|
for json in $(find . -name "*.json"); do
jsonlint -v $json
if [[ $? -ne 0 ]]; then
echo "ERROR parsing $json"
exit 1
fi
done
-
|
pushd playbooks
for j2 in $(git diff --name-only refs/heads/master..$(git rev-parse --abbrev-ref HEAD) |grep -E '.+\.j2$|.+\.yml'); do
python ../tests/jinja_check.py ../$j2
if [[ $? -ne 0 ]]; then
echo "Jinja parsing error on $j2"
exit 1
fi
done
popd
-
|
set -e
ROOT_DIR=$PWD
cd playbooks/edx-east
ROLE_DIRS=$(/bin/ls -d roles/*)
cat <<EOF >travis-test.yml
- name: Play to test all roles
hosts: all
roles:
EOF
for role_dir in $ROLE_DIRS; do
echo " - $(basename $role_dir)" >> travis-test.yml
done
ansible-playbook -i localhost, --syntax-check travis-test.yml
output_dir="$PWD/test_output/env-dep"
mkdir -p $output_dir
ansible-playbook -i localhost, -c local --tags edxapp_cfg edxapp.yml -e edxapp_user=`whoami` -e edxapp_app_dir=$output_dir -e edxapp_code_dir=$output_dir -e EDXAPP_CFG_DIR=$output_dir
root_dir=$output_dir
environment_deployments="."
source $ROOT_DIR/tests/validate_templates.sh
-
cd $TRAVIS_BUILD_DIR; make docker.test
-
make $MAKE_TARGET
Makefile
View file @
5a2d17d8
...
...
@@ -30,6 +30,12 @@ help:
@
echo
' make docker.pkg package all defined docker containers (using local base images)'
@
echo
' make docker.push push all defined docker containers'
@
echo
''
@
echo
' Tests:'
@
echo
' test.syntax Run all syntax tests'
@
echo
' test.syntax.json Run syntax tests on .json files'
@
echo
' test.syntax.yml Run syntax tests on .yml files'
@
echo
' test.syntax.jinja Run syntax tests on .j2 files'
@
echo
' test.edx_east_roles Run validation on edx-east roles'
@
echo
''
requirements
:
...
...
test.mk
0 → 100644
View file @
5a2d17d8
yml_files:=$(shell find . -name "*.yml")
json_files:=$(shell find . -name "*.json")
jinja_files:=$(shell find . -name "*.j2")
test: test.syntax test.edx_east_roles
test.syntax: test.syntax.yml test.syntax.json test.syntax.jinja
test.syntax.yml: $(patsubst %,test.syntax.yml/%,$(yml_files))
test.syntax.yml/%:
python -c "import sys,yaml; yaml.load(open(sys.argv[1]))" $* >/dev/null
test.syntax.json: $(patsubst %,test.syntax.json/%,$(json_files))
test.syntax.json/%:
jsonlint -v $*
test.syntax.jinja: $(patsubst %,test.syntax.jinja/%,$(jinja_files))
test.syntax.jinja/%:
cd playbooks && python ../tests/jinja_check.py ../$*
test.edx_east_roles:
tests/test_edx_east_roles.sh
tests/test_edx_east_roles.sh
0 → 100755
View file @
5a2d17d8
set
-e
ROOT_DIR
=
$PWD
cd
playbooks/edx-east
ROLE_DIRS
=
$(
/bin/ls
-d
roles/
*)
cat
<<
EOF
>travis-test.yml
- name: Play to test all roles
hosts: all
roles:
EOF
for
role_dir
in
$ROLE_DIRS
;
do
echo
" -
$(
basename
$role_dir
)
"
>>
travis-test.yml
done
ansible-playbook
-i
localhost,
--syntax-check
travis-test.yml
output_dir
=
"
$PWD
/test_output/env-dep"
mkdir
-p
$output_dir
ansible-playbook
-i
localhost,
-c
local
--tags
edxapp_cfg edxapp.yml
-e
edxapp_user
=
`
whoami
`
-e
edxapp_app_dir
=
$output_dir
-e
edxapp_code_dir
=
$output_dir
-e
EDXAPP_CFG_DIR
=
$output_dir
root_dir
=
$output_dir
environment_deployments
=
"."
source
$ROOT_DIR
/tests/validate_templates.sh
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment