From 95e82c222b9fb26889829c5b0dae2053153e409e Mon Sep 17 00:00:00 2001 From: amercader Date: Tue, 15 Dec 2020 16:01:37 +0100 Subject: [PATCH] Remove test-ga.ini, use env instead --- .github/workflows/test.yml | 16 +++++--- test-ga.ini | 77 -------------------------------------- 2 files changed, 11 insertions(+), 82 deletions(-) delete mode 100644 test-ga.ini diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0cc83e..9c462d2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,6 +36,12 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 redis: image: redis:3 + env: + CKAN_SQLALCHEMY_URL: postgresql://ckan_default:pass@postgres/ckan_test + CKAN_DATASTORE_WRITE_URL: postgresql://datastore_write:pass@postgres/datastore_test + CKAN_DATASTORE_READ_URL: postgresql://datastore_read:pass@postgres/datastore_test + CKAN_SOLR_URL: http://solr:8983/solr/ckan + CKAN_REDIS_URL: redis://redis:6379/1 steps: - uses: actions/checkout@v2 @@ -47,12 +53,12 @@ jobs: - name: Setup extension (CKAN >= 2.9) if: ${{ matrix.ckan-version != '2.7' && matrix.ckan-version != '2.8' }} run: | - ckan -c test-ga.ini db init - ckan -c test-ga.ini harvester initdb + ckan -c test.ini db init + ckan -c test.ini harvester initdb - name: Setup extension (CKAN < 2.9) if: ${{ matrix.ckan-version == '2.7' || matrix.ckan-version == '2.8' }} run: | - paster --plugin=ckan db init -c test-ga.ini - paster --plugin=ckanext-harvest harvester initdb -c test-ga.ini + paster --plugin=ckan db init -c test.ini + paster --plugin=ckanext-harvest harvester initdb -c test.ini - name: Run tests - run: pytest --ckan-ini=test-ga.ini --cov=ckanext.harvest --disable-warnings ckanext/harvest/tests + run: pytest --ckan-ini=test.ini --cov=ckanext.harvest --disable-warnings ckanext/harvest/tests diff --git a/test-ga.ini b/test-ga.ini deleted file mode 100644 index 920f4e1..0000000 --- a/test-ga.ini +++ /dev/null @@ -1,77 +0,0 @@ -[DEFAULT] -debug = false -# Uncomment and replace with the address which should receive any error reports -#email_to = you@yourdomain.com -smtp_server = localhost -error_email_from = paste@localhost - -[server:main] -use = egg:Paste#http -host = 0.0.0.0 -port = 5000 - - -[app:main] -use = config:/srv/app/src/ckan/test-core.ini - -ckan.datastore.write_url = postgresql://datastore_write:pass@postgres/datastore_test -ckan.datastore.read_url = postgresql://datastore_read:pass@postgres/datastore_test -sqlalchemy.url = postgresql://ckan_default:pass@postgres/ckan_test -solr_url = http://solr:8983/solr/ckan -ckan.redis.url = redis://redis:6379/1 - -# Here we hard-code the database and a flag to make default tests -# run fast. -ckan.plugins = harvest ckan_harvester test_harvester test_harvester2 test_action_harvester -ckan.harvest.mq.type = redis -ckan.legacy_templates = false -# NB: other test configuration should go in test-core.ini, which is -# what the postgres tests use. - - -# Logging configuration -[loggers] -keys = root, ckan, sqlalchemy - -[handlers] -keys = console, dblog - -[formatters] -keys = generic, dblog - -[logger_root] -level = WARN -handlers = console - -[logger_ckan] -qualname = ckan -handlers = -level = INFO - -[logger_ckan_harvester] -qualname = ckanext.harvest -handlers = dblog -level = DEBUG - -[logger_sqlalchemy] -handlers = -qualname = sqlalchemy.engine -level = WARN - -[handler_console] -class = StreamHandler -args = (sys.stdout,) -level = NOTSET -formatter = generic - -[handler_dblog] -class = ckanext.harvest.log.DBLogHandler -args = () -level = DEBUG -formatter = dblog - -[formatter_dblog] -format = %(message)s - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s