-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from JWCook/integration-tests
Set up integration tests to run both locally and in GitHub Actions
- Loading branch information
Showing
16 changed files
with
285 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
*.py[cod] | ||
*.idea | ||
*.sqlite | ||
*.egg | ||
*.egg-info | ||
.idea/ | ||
.vim/ | ||
.vscode/ | ||
build/ | ||
dist/ | ||
venv/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Contributing | ||
|
||
## Installation | ||
To set up for local development: | ||
|
||
```bash | ||
$ git clone https://github.com/JWCook/aiohttp-client-cache | ||
$ cd aiohttp-client-cache | ||
$ pip install -Ue ".[dev]" | ||
``` | ||
|
||
## Pre-commit hooks | ||
[Pre-commit](https://github.com/pre-commit/pre-commit) config is uncluded to run the same checks | ||
locally that are run in CI jobs by GitHub Actions. This is optional but recommended. | ||
```bash | ||
$ pre-commit install --config .github/pre-commit.yml | ||
``` | ||
|
||
To uninstall: | ||
```bash | ||
$ pre-commit uninstall | ||
``` | ||
|
||
## Integration Tests | ||
Local databases are required to run integration tests, and docker-compose config is included to make | ||
this easier. First, [install docker](https://docs.docker.com/get-docker/) and | ||
[install docker-compose](https://docs.docker.com/compose/install/). | ||
|
||
Then, run: | ||
```bash | ||
$ docker-compose up -d | ||
pytest test/integration | ||
``` | ||
|
||
## Documentation | ||
[Sphinx](http://www.sphinx-doc.org/en/master/) is used to generate documentation. | ||
|
||
To build the docs locally: | ||
```bash | ||
$ make -C docs html | ||
``` | ||
|
||
To preview: | ||
```bash | ||
# MacOS: | ||
$ open docs/_build/index.html | ||
# Linux: | ||
$ xdg-open docs/_build/index.html | ||
``` | ||
|
||
Documentation is automatically built by ReadTheDocs whenever code is merged into the `main` branch. | ||
|
||
|
||
## Releases | ||
Releases are built and published to pypi based on **git tags.** | ||
[Milestones](https://github.com/JWCook/aiohttp-client-cache/milestones) will be used to track | ||
progress on major and minor releases. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Containers needed to test all backend services locally | ||
version: '3' | ||
|
||
services: | ||
dynamodb: | ||
image: amazon/dynamodb-local | ||
hostname: dynamodb-local | ||
container_name: dynamodb-local | ||
ports: | ||
- 8000:8000 | ||
command: "-jar DynamoDBLocal.jar -sharedDb -optimizeDbBeforeStartup -dbPath ./data" | ||
volumes: | ||
- 'dynamodb_data:/home/dynamodblocal/data' | ||
working_dir: /home/dynamodblocal | ||
|
||
mongo: | ||
image: mongo | ||
environment: | ||
MONGO_INITDB_DATABASE: aiohttp_client_cache_pytest | ||
ports: | ||
- 27017:27017 | ||
volumes: | ||
- 'mongodb_data:/data/db' | ||
|
||
redis: | ||
image: docker.io/bitnami/redis | ||
environment: | ||
ALLOW_EMPTY_PASSWORD: 'yes' | ||
# REDIS_DISABLE_COMMANDS: 'FLUSHDB,FLUSHALL' | ||
ports: | ||
- 6379:6379 | ||
volumes: | ||
- 'redis_data:/bitnami/redis/data' | ||
|
||
volumes: | ||
dynamodb_data: | ||
driver: local | ||
mongodb_data: | ||
driver: local | ||
redis_data: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.. mdinclude:: ../CONTRIBUTING.md | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ Contents | |
|
||
reference | ||
history | ||
contributing | ||
|
||
|
||
Indices and tables | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.