Skip to main content

API testing for BC Data Catalog

Project description

Automated BCDC API Testing

Intention is to test the CKAN API after deployment.

Current tests include:

  • verification of preconfigured orgs required for testing
  • CRUD tests for packages.

OC Build for BCDC-TEST

pulls package from https://pypi.org/project/bcdc-apitests/ new OC build triggered by github actions on commit to master branch

how to create new build from build config

oc create -f https://raw.githubusercontent.com/bcgov/bcdc-test/k8s/bcdc-test-buildconfig.yaml

start build

oc start-build bcdc-test -n databcdc

OC Jobs for BCDC-TEST

each environment will have its own defined .yaml file within the k8s dir.

  • test-dwelf-job-template.yaml
  • test-toyger-job-template.yaml

how to run job from yaml as template, so we can change the name using a generated value appended to name

  • CADI
oc process -f https://raw.githubusercontent.com/bcgov/bcdc-test/k8s/test-dwelf-job-template.yaml | oc create -f -
  • CATI
oc process -f https://raw.githubusercontent.com/bcgov/bcdc-test/k8s/test-toyger-job-template.yaml | oc create -f -

OC Development Build for BCDC-TEST-DEV

pulls from https://pypi.org/project/bcdc-apitests-dev/ new OC build triggered by github actions on push to dev branch

oc create -f https://raw.githubusercontent.com/bcgov/bcdc-test/k8s/bcdc-test-buildconfig-dev.yaml

OC Developmnet Jobs for BCDC-TEST-DEV

  • CADI
oc process -f https://raw.githubusercontent.com/bcgov/bcdc-test/k8s/test-dwelf-job-template-dev.yaml | oc create -f -
  • CATI
oc process -f https://raw.githubusercontent.com/bcgov/bcdc-test/k8s/test-toyger-job-template-dev.yaml | oc create -f -

Run Tests locally

pip install pypandoc 
pip install bcdc_apitests
export BCDC_API_KEY=<api-key>
export BCDC_URL=<url-to-ckan>
pytest --pyargs bcdc_apitests

Packaging

disable teardown

--df Include this switch if you want to disable teardown that deletes the test data that gets generated by the test suite. The various options basically tell the test suite not to delete a particular type of data that are generated by the tests.

Options include:

  • orgs
  • groups
  • packages
  • resources
  • users
  • other
  • ALL

Packaging

Packaging is currently configured to be built automatically by github actions when a pull request on master has been successfully merged.

packaging version numbers

When a new package is built it will automatically check what the last version is in PYPI for the package and increment that number.

Example if the version in pypi is 7.3.45, the next time the github action triggers it will be 7.3.46. If you want the change either the major or the minor number set the number in packages init.py file, for example to increment the major version number to 8.

...
version=8.0.0
...

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bcdc-apitests-dev-1.0.17.tar.gz (69.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bcdc_apitests_dev-1.0.17-py3-none-any.whl (98.5 kB view details)

Uploaded Python 3

File details

Details for the file bcdc-apitests-dev-1.0.17.tar.gz.

File metadata

  • Download URL: bcdc-apitests-dev-1.0.17.tar.gz
  • Upload date:
  • Size: 69.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for bcdc-apitests-dev-1.0.17.tar.gz
Algorithm Hash digest
SHA256 b84b4ff1d91ed64f33314297afd70bd2942dda20f26b504ca32e9cf79cf8ce2f
MD5 029beddf91696de3618954b9a451be54
BLAKE2b-256 a6baa911f19a14c4f23c33b1aee53a3d989268588057db6d62ed2f9b9a635ad6

See more details on using hashes here.

File details

Details for the file bcdc_apitests_dev-1.0.17-py3-none-any.whl.

File metadata

  • Download URL: bcdc_apitests_dev-1.0.17-py3-none-any.whl
  • Upload date:
  • Size: 98.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for bcdc_apitests_dev-1.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 a8ee4510fd3d5552aba49ac6e940044bc4055a7b1064dd8829ead1ed97ed0a98
MD5 3ca2ace3687658f520f4db3df8144ad5
BLAKE2b-256 e39f0e39c7c764a7fee36ed885a967fd634d218017a91439c9733dfe568407ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page