Skip to main content

Schul-Cloud Search API

Project description

Build Status Python Package Index Dockerhub Automated Build Status First Timers

These are the tests for the Schul-Cloud search API. You can read motivation blog post about

  • common tests for all search engines

  • testing during live deployment

Installation

You can install the tests by installing Python version 3 and pip. Then, you run the installation from the command line:

pip install --user schul-cloud-search-tests

Installation for Development

If you would like to contribute code to this repository, you can clone it first.

git clone https://github.com/schul-cloud/schul_cloud_search_tests.git
cd schul_cloud_search_tests

Install the required packages for Python:

pip3 install --user -r requirements.txt pip-tools==1.6.5

Note that if you would like to change the requirements, please edit the requirements.in file and run this command to update the dependencies:

pip-compile --output-file requirements.txt requirements.in

Specification

The idea is that these tests run in between your search client and your search engine or search adapter. You use the test interface instead of your search engine interface to run checks on every request the client makes:

  • Is the client request formulated correctly?

  • Is the server response folmulated correctly?

These cases can be defined and are defined:

  • When the client issues a successful request and the server responds correctly, the request is forwarded, optionally including a note that the tests passed.

  • When the client issues a malformed request, HTTP error 555 is returned including the information which tests did not pass. The request is not forwarded to the server. To verify this, the client request is included in the reponse.

  • When the client issues a correct request, and the server response is malformed, then HTTP error 556 is returned including a list of error descriptions of the mistakes made by the server. To verify this, also the server response is included in the errors.

Usage

Suppose you have a server running on http://localhost:1234/v1/search/. You can tun the search engine tests as a proxy on port 8080 like this:

python3 -m schul_cloud_search_tests.proxy 8080/endpoint/ http://localhost:1234/v1/search/

Now, all your requests to http://localhost:8080/endpoint/ will be forwarded to http://localhost:1234/v1/search/.

When you are done, you can visit http://localhost:8080/stop to stop the server or run this command:

python3 -m schul_cloud_search_tests.stop 8080

Further Reading


You can edit this document on Github and check it with this editor.

Project details


Download files

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

Source Distribution

schul_cloud_search_tests-1.0.3.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

schul_cloud_search_tests-1.0.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file schul_cloud_search_tests-1.0.3.tar.gz.

File metadata

File hashes

Hashes for schul_cloud_search_tests-1.0.3.tar.gz
Algorithm Hash digest
SHA256 5a49bc4cdc9cbe5be39a2f409f3da5d84ad5f08e77d37761e164f30f2da3c938
MD5 55a55cb0afd98bb158defb89e8304cc1
BLAKE2b-256 0a58e93c36fd211e2e04aa363597dde9acbcd065b68c467ee0bcf67e0d8c06c9

See more details on using hashes here.

File details

Details for the file schul_cloud_search_tests-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for schul_cloud_search_tests-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 220707d1edeaf570285a25132fb202b15479de482133ae0d6647a463d5bdb166
MD5 0d01dfb637bc283f447fa84bd8c08e6f
BLAKE2b-256 c91b0e737f443809cffc40f7cf113a281b9f548e9b331b9453b43dd7adab674b

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