I hereby claim:
- I am mgough on github.
- I am merlingough (https://keybase.io/merlingough) on keybase.
- I have a public key ASDg384GHcuTZFSaPJSSvf0gNA-yPUHFlBiln0Aq-IGXvQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
FROM python:3.7 | |
RUN mkdir /app/ | |
WORKDIR /app/ | |
COPY requirements.txt /app/ | |
RUN pip install -r requirements.txt | |
COPY our_codebase /app/our_codebase | |
COPY some_script.py /app/ |
ARG BUILD_VERSION | |
FROM our-service:$BUILD_VERSION | |
COPY test /app/test | |
COPY dev-requirements.txt /app/ | |
RUN pip install -r dev-requirements.txt | |
CMD python -m pytest --junitxml /app/results.xml --cov=/app/our_codebase --cov-report xml test/ |
// This is just a snippet, not a complete file | |
try { | |
stage('Unit Tests') { | |
// Build our base image | |
app = docker.build("our-service:PR-${BUILD_ID}") | |
// Build our test image passing our base image version and our test dockerfile | |
docker.build("our-service-test:PR-$BUILD_ID", "--build-arg BUILD_VERSION=PR-$BUILD_ID . -f test.Dockerfile") | |
from src.imported_class import SomeClassOutOfOurControl | |
class SomeObjectToTest: | |
some_property = 5 | |
some_other_property = 10 | |
def __init__(self): | |
self.calculator = SomeClassOutOfOurControl() |
from abc import abstractmethod | |
class SomeClassOutOfOurControl: | |
@abstractmethod | |
def add(self, a, b): | |
raise NotImplementedError("We don't care about this") |
from unittest.mock import patch, Mock | |
from pytest import fixture | |
from src.example import SomeObjectToTest | |
class TestSomeObjectToTest: | |
@fixture | |
def expected_result(self): | |
return 400 |
from abc import abstractmethod | |
class SomeClassOutOfOurControl: | |
@abstractmethod | |
def add(self, items): | |
raise NotImplementedError("We don't care about this") |
from unittest.mock import patch, Mock, create_autospec | |
from pytest import fixture | |
from service.example import SomeObjectToTest | |
from service.imported_class import SomeClassOutOfOurControl | |
class TestSomeObjectToTest: | |
@fixture | |
def expected_result(self): |
a: | |
00863395735779106D01A3B: 30 | |
00863531904040789C8A4C6: 31 | |
00863604179437128DD9A2B: 32 | |
00873485276243227609735: 33 | |
0087352270643094413B0D7: 34 | |
008736034269259128AC6C7: 35 | |
00883394559972599E77AEC: 36 | |
008B3600524843455E61C85: 37 | |
008C3378065645906E77882: 38 |