Skip to content
Ondrej Kosarko edited this page Dec 6, 2024 · 1 revision

How to run oai tests locally

Before

  1. Modify test_oai/init.py to add "elg" to the tested formats list (line 56).
  2. Run the DSpace database with data (use a dump from dev-5).
  3. Modify the db__P__url variable in docker-compose-rest.yml to point to your local IP and port of the running DSpace database.
  4. Add the following line to the pg_hba.conf file in PostgreSQL: host all all [your local host address]/32 md5
  5. Copy the elg.xsl file from the DSpace backend to the docker/ directory. Then, add this line to the docker-compose-rest.yml file under the services/dspace section: - ./elg.xsl:/dspace/config/crosswalks/oai/metadataFormats/elg.xsl
  6. Run DSpace in Docker.
  7. Import OAI: In DSpace, go to Exec and run the following commands: bash cd /dspace/bin
    ./dspace oai import -c

Notes: If you make modifications to the elg.xsl file, you will need to rebuild the backend container: Delete dspace0. Run the command to create the containers again. Execute the OAI import commands.

Running from PyCharm:

  1. Create a new configuration.

    • Module name: test_oai.test_OAI.test_diff_oaipmh_output
    • Environment variables: DSPACE_REST_API=http://localhost:8080/server/api (for local setup, otherwise use dev-5.pc)
    • Working directory: [path]\dspace-rest-test\tests
Clone this wiki locally