Skip to content

Commit

Permalink
Moved tests from Dockerfile to Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
setenforce0 committed Oct 13, 2019
1 parent ebb1e31 commit a39a16a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 17 deletions.
48 changes: 40 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
sudo: required
language: minimal
services:
- docker

script:
- sh scripts/deploy.sh

jobs:
include:
- stage: build
language: minimal
services:
- docker
script:
- docker build -t $IMAGE_NAME:$TRAVIS_COMMIT .
- echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
- docker push $IMAGE_NAME:$TRAVIS_COMMIT
- stage: deploy
if: (NOT type IN (pull_request)) AND (branch = master)
language: minimal
services:
- docker
script:
- docker pull $IMAGE_NAME:$TRAVIS_COMMIT
- docker tag $IMAGE_NAME:$TRAVIS_COMMIT $IMAGE_NAME:latest
- echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
- docker push $IMAGE_NAME:latest
- stage: test
sudo: required
dist: bionic
language: python
addons:
chrome: stable
python:
- 3.6
services:
- docker
- xvfb
script:
- sudo apt update
- sudo apt install --force-yes chromium-browser chromium-chromedriver
- pip3 install --upgrade pip
- pip3 install -U seleniumbase pytest
- docker run -d -p 127.0.0.1:8080:8080/tcp $IMAGE_NAME:$TRAVIS_COMMIT
- sleep 10
- cd tests
- pytest --headless -n 8 --reruns 10 --reruns-delay 2
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ COPY . /src/nitter
WORKDIR /src/nitter

RUN apk update \
&& apk add python3 python3-dev bash libsass libsass-dev chromium chromium-chromedriver libffi libffi-dev openssl-dev \
&& pip3 install --upgrade pip && pip3 install -U seleniumbase pytest \
&& apk add libsass-dev libffi-dev openssl-dev \
&& nimble build -y -d:release -d:hostname=${HOSTNAME} \
&& nimble scss \
&& mkdir -p ./tmp \
&& bash -c "./nitter & cd tests && pytest --headless -n 8 --reruns 5 --reruns-delay 1 && kill %1"
&& nimble scss

FROM alpine
WORKDIR /src/
Expand Down
4 changes: 0 additions & 4 deletions scripts/deploy.sh

This file was deleted.

0 comments on commit a39a16a

Please sign in to comment.