Skip to content

Commit

Permalink
Merge pull request #118 from NaturalHistoryMuseum/josh/test_on_210
Browse files Browse the repository at this point in the history
Add ckantest:next as a test target option
  • Loading branch information
jrdh authored Sep 21, 2023
2 parents 08a9c9e + 69106a6 commit 112a385
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
- name: Run tests
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: docker-compose run -e COVERALLS_REPO_TOKEN ckan bash /opt/scripts/run-tests.sh -c ckanext.ldap
run: docker-compose run -e COVERALLS_REPO_TOKEN latest bash /opt/scripts/run-tests.sh -c ckanext.ldap
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ To run the tests against ckan 2.9.x on Python3:
configuration, so you should only need to rebuild the ckan image if you change the extension's
dependencies.
```shell
docker-compose run ckan
docker-compose run latest
```
<!--testing-end-->
19 changes: 17 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
version: "3"

services:
ckan:
latest:
build:
context: .
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile_latest
environment:
PYTHONUNBUFFERED: 1
PYTHONDONTWRITEBYTECODE: 1
depends_on:
- db
- solr
- redis
volumes:
- ./ckanext:/base/src/ckanext-ldap/ckanext
- ./tests:/base/src/ckanext-ldap/tests

next:
build:
context: .
dockerfile: docker/Dockerfile_next
environment:
PYTHONUNBUFFERED: 1
PYTHONDONTWRITEBYTECODE: 1
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions docker/Dockerfile_next
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM naturalhistorymuseum/ckantest:next

# required by python-ldap
RUN apt-get -q -y install libldap2-dev libsasl2-dev \
&& apt-get -q clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /base/src/ckanext-ldap

# copy over the source
COPY . .

# install the base + test dependencies
RUN pip install -e .[test]

# this entrypoint ensures our service dependencies (postgresql, solr and redis) are running before
# running the cmd
ENTRYPOINT ["/bin/bash", "/opt/waits/basic.sh"]

# run the tests with coverage output
CMD ["bash", "/opt/scripts/run-tests.sh", "ckanext.ldap"]

0 comments on commit 112a385

Please sign in to comment.