Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiments around tests #149

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ addons:
- service1.example.com
- service2.example.com
- service3.example.com
install:
- travis_fold start "Install.Pip.Package" && make install-dev && pip3 show mockintosh && travis_fold end "Install.Pip.Package"
- travis_fold start "Build.Image" && make build && docker image ls mockintosh && travis_fold end "Build.Image"
script:
- stty cols 120
- ./ps.sh &
- travis_fold start "Unit.Tests" && make test-with-coverage && travis_fold end "Unit.Tests"
- travis_fold start "StopContainers.Tests" && make stop-containers && travis_fold end "StopContainers.Tests"
- travis_fold start "Integration.Tests" && make test-integration && travis_fold end "Integration.Tests"
- ./tests.sh
after_success:
- if [[ $TRAVIS_TAG =~ ^([0-9]+\.?)+$ ]]; then git push --force https://${GH_TOKEN}@github.com/up9inc/mockintosh.git HEAD:gh-pages; else echo Not pushing "$TRAVIS_TAG"; fi
- make coverage-after
Expand Down
19 changes: 19 additions & 0 deletions tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash -xe

# this file is single entrypoint, to be used in local Dockerized tests
cd $(dirname $0)

rm -f .coverage.*
docker ps # test if docker is operational
docker kill kafka || true

make build
docker run -it mockintosh --help
docker image ls mockintosh

tests/ps.sh &

make install-dev
make test-with-coverage
make stop-containers
make test-integration
10 changes: 10 additions & 0 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM up9inc/mockintosh

RUN apt update && apt install -y rsync docker.io build-essential

RUN pip uninstall -y mockintosh

RUN echo 127.0.0.1 service1.example.com >> /etc/hosts
RUN echo 127.0.0.1 service2.example.com >> /etc/hosts
RUN echo 127.0.0.1 service3.example.com >> /etc/hosts

File renamed without changes.
Loading