Commit 325c3efe by Feanil Patel Committed by GitHub

Merge pull request #1026 from edx/feanil/ecommerce_docker_testing

Test ecommerce via the container built in configuration.
parents 4cd3999a 2784e5eb
language: python
python:
- "2.7"
sudo: false
# Cache the pip directory. "cache: pip" doesn't work due to install override. See https://github.com/travis-ci/travis-ci/issues/3239.
sudo: required
services:
- docker
cache:
- bundler
- pip
- directories:
- $HOME/.cache/pip
- node_modules
- ecommerce/static/bower_components
addons:
firefox: latest
apt:
packages:
- lcov
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "export DJANGO_SETTINGS_MODULE=ecommerce.settings.test"
install:
- pip install -U codecov
- pip install -U pip wheel
- make requirements
script:
# Ensure documentation can be compiled
- cd docs && make html
- cd ..
- docker-compose -f ./.travis/docker-compose-travis.yml up -d
# Check if translation files are up-to-date
- make validate_translations
script:
- docker exec ecommerce_testing /edx/app/ecommerce/ecommerce/.travis/run_tests.sh
# Compile assets and run validation
- make clean_static
- make static
- make validate_python
- make validate_js
after_success:
- pip install -U codecov
- docker exec ecommerce_testing /edx/app/ecommerce/ecommerce/.travis/run_coverage.sh
- codecov
# This is only meant to be used for testing on travis-ci.org
version: "2"
services:
ecommerce:
image: edxops/ecommerce:latest
container_name: ecommerce_testing
volumes:
- ..:/edx/app/ecommerce/ecommerce
- $HOME/.cache/pip:/edx/app/ecommerce/.cache/pip
# The docker container produced from configuration.git does not currently
# run and expose a port for ecommerce. This means that we need to run some
# command that keeps the ecommerce container alive while we run tests on it.
# We have not yet standardized on an init replacement which could be used instead.
command: tail -f /dev/null
#!/bin/bash -xe
. /edx/app/ecommerce/venvs/ecommerce/bin/activate
cd /edx/app/ecommerce/ecommerce
coverage xml
#!/bin/bash -xe
. /edx/app/ecommerce/venvs/ecommerce/bin/activate
. /edx/app/ecommerce/nodeenvs/ecommerce/bin/activate
apt update
apt install -y xvfb firefox gettext
cd /edx/app/ecommerce/ecommerce
# Make it so bower can run without sudo.
# https://github.com/GeoNode/geonode/pull/1070
echo '{ "allow_root": true }' > /root/.bowerrc
make requirements
# Ensure documentation can be compiled
cd docs && make html
cd ..
export DJANGO_SETTINGS_MODULE=ecommerce.settings.test
# Check if translation files are up-to-date
make validate_translations
# Compile assets and run validation
make clean_static
make static
xvfb-run make validate_python
xvfb-run make validate_js
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment