Skip to content

Commit fc62e50

Browse files
committedJan 27, 2023
Initial commit
0 parents  commit fc62e50

25 files changed

+1386
-0
lines changed
 

‎.coveragerc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[report]
2+
omit =
3+
*/site-packages/*
4+
*/python?.?/*
5+
ckan/*

‎.github/workflows/test.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
container:
7+
# The CKAN version tag of the Solr and Postgres containers should match
8+
# the one of the container the tests run on.
9+
# You can switch this base image with a custom image tailored to your project
10+
image: openknowledge/ckan-dev:2.9
11+
services:
12+
solr:
13+
image: ckan/ckan-solr-dev:2.9
14+
postgres:
15+
image: ckan/ckan-postgres-dev:2.9
16+
env:
17+
POSTGRES_USER: postgres
18+
POSTGRES_PASSWORD: postgres
19+
POSTGRES_DB: postgres
20+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
21+
redis:
22+
image: redis:3
23+
24+
env:
25+
CKAN_SQLALCHEMY_URL: postgresql://ckan_default:pass@postgres/ckan_test
26+
CKAN_DATASTORE_WRITE_URL: postgresql://datastore_write:pass@postgres/datastore_test
27+
CKAN_DATASTORE_READ_URL: postgresql://datastore_read:pass@postgres/datastore_test
28+
CKAN_SOLR_URL: http://solr:8983/solr/ckan
29+
CKAN_REDIS_URL: redis://redis:6379/1
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
- name: Install requirements
34+
# Install any extra requirements your extension has here (dev requirements, other extensions etc)
35+
run: |
36+
pip install -r requirements.txt
37+
pip install -r dev-requirements.txt
38+
pip install -e .
39+
- name: Setup extension
40+
# Extra initialization steps
41+
run: |
42+
# Replace default path to CKAN core config file with the one on the container
43+
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini
44+
45+
ckan -c test.ini db init
46+
- name: Run tests
47+
run: pytest --ckan-ini=test.ini --cov=ckanext.generalpublic --disable-warnings ckanext/generalpublic
48+

‎.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.ropeproject
2+
node_modules
3+
bower_components
4+
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
9+
# C extensions
10+
*.so
11+
12+
# Distribution / packaging
13+
.Python
14+
env/
15+
build/
16+
develop-eggs/
17+
dist/
18+
sdist/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# PyInstaller
24+
# Usually these files are written by a python script from a template
25+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
26+
*.manifest
27+
*.spec
28+
29+
# Installer logs
30+
pip-log.txt
31+
pip-delete-this-directory.txt
32+
33+
# Unit test / coverage reports
34+
htmlcov/
35+
.tox/
36+
.coverage
37+
.cache
38+
nosetests.xml
39+
coverage.xml
40+
41+
# Sphinx documentation
42+
docs/_build/

0 commit comments

Comments
 (0)