Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
Chore/circleci (#125)
Browse files Browse the repository at this point in the history
* chore: convert to .circleci

Closes: #124
  • Loading branch information
jrconlin authored Jan 15, 2021
1 parent 9f5ce15 commit 8ac4b73
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 18 deletions.
55 changes: 55 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# These environment variables must be set in CircleCI UI
#
# DOCKERHUB_REPO - docker hub repo, format: <username>/<repo>
# DOCKER_USER - login info for docker hub
# DOCKER_PASS
#
version: 2.1
defaults:
docker_login: &docker_login
run:
name: Login to Dockerhub
command: |
if [ "${DOCKER_USER}" == "" ] || [ "${DOCKER_PASS}" == "" ]; then
echo "Skipping Login to Dockerhub, no credentials."
else
echo "${DOCKER_PASS}" | docker login -u="${DOCKER_USER}" --password-stdin
fi
jobs:
test:
docker:
- image: pypy:2.7
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
# Future TODO: use a local dynamodb
working_directory: /app
steps:
- checkout
- setup_remote_docker
- run:
name: Install Docker test dependencies
command: |
apt update
apt install -y pypy-dev
pip install tox flake8
#- run:
# name: flake8
# command: |
# flake8 aplt
- run:
name: run tests & coverage
environment:
TOXENV: pypy
CODECOV: true
command: |
tox -e ALL
workflows:
version: 2
build-test-deploy:
jobs:
- test:
filters:
tags:
only: /.*/
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion aplt/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, api_key, app_key, flush_interval=10,
datadog.initialize(api_key=api_key, app_key=app_key)
self._client = ThreadStats()
self._flush_interval = flush_interval
self._host = get_hostname()
self._host = get_hostname(False)
self._namespace = namespace

def _prefix_name(self, name):
Expand Down
2 changes: 1 addition & 1 deletion aplt/tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_basic(self, mock_reactor):
class DatadogMetricsTestCase(unittest.TestCase):
@patch("aplt.metrics.datadog")
def test_basic(self, mock_dog):
hostname = get_hostname()
hostname = get_hostname(False)

m = DatadogMetrics("someapikey", "someappkey", namespace="testpush")
ok_(len(mock_dog.mock_calls) > 0)
Expand Down

0 comments on commit 8ac4b73

Please sign in to comment.