Skip to content

Commit

Permalink
Add selenium to github actions (#4730)
Browse files Browse the repository at this point in the history
* Add selenium to github actions

* Try a docker approach

* Remove Travis env vars

* Fix obscure dockerfile error by eliminating two COPY in a row
moby/moby#37965 (comment)

* WIP

* Add trailing slash

* Use .env.example

* docker-compose.travis.yml was deleted

* Copy .env file

* Add a bug just to make sure it fails the test

* Success, remove the bug
  • Loading branch information
George Schneeloch authored Jan 26, 2021
1 parent 67627ec commit 30afec9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,19 @@ jobs:
with:
file: coverage/lcov.info
fail_ci_if_error: true

selenium-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Selenium
run: |
cp .env.example .env
docker build -t micromasters_watch -f ./Dockerfile-node .
docker build -t travis-watch -f ./travis/Dockerfile-travis-watch .
docker run --name travis-watch-container --env-file .env -e NODE_ENV=production -t travis-watch ./webpack_if_prod.sh
docker cp travis-watch-container:/src/webpack-stats.json .
docker cp travis-watch-container:/src/static/bundles ./static/bundles
./scripts/test/run_selenium_tests_travis.sh
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ RUN adduser --disabled-password --gecos "" mitodl
RUN mkdir /var/media && chown -R mitodl:mitodl /var/media

# Install project packages
COPY requirements.txt /tmp/requirements.txt
COPY test_requirements.txt /tmp/test_requirements.txt
COPY *requirements.txt /tmp/
RUN pip install -r requirements.txt -r test_requirements.txt

# Add project
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/run_selenium_tests_travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ then
echo "webpack-stats.json must exist before running the selenium tests. Run webpack to create it."
exit 1
fi
docker-compose -f docker-compose.yml -f docker-compose.travis.yml -f docker-compose.selenium.yml run \
docker-compose -f docker-compose.yml -f docker-compose.selenium.yml run \
selenium py.test ./selenium_tests
6 changes: 1 addition & 5 deletions travis/Dockerfile-travis-watch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ FROM micromasters_watch

WORKDIR /src

COPY package.json /src

COPY yarn.lock /src

ADD ./webpack_if_prod.sh /src
COPY ./webpack_if_prod.sh yarn.lock package.json /src/

USER root

Expand Down

0 comments on commit 30afec9

Please sign in to comment.