-
Notifications
You must be signed in to change notification settings - Fork 0
Testing against single records
Often you want to get new data into the Arclight Solr index to develop a new feature in Arclight. In these cases it can help to have a working example but you may not want to update all of your data; or, you may want to iteratively work on the Arcflow feature or test its functionality against a single record. Here is how I've done that in the past:
Of course. I can help with that. To suggest the best way to test this pull request on a single record, I first need to understand the changes made in the PR. I'll retrieve the file changes for this pull request and then provide you with a testing strategy.Of course. Based on the changes in the pull request, here is a suggested way to test this on a single record.
The pull request introduces functionality to add biographical or historical notes about the creator to the EAD XML export. To test this, you'll need to run the updated arcflow code against a specific resource in your ArchivesSpace instance that is linked to a creator agent with a biographical/historical note.
First, get the code from the pull request onto your development machine.
# First, fetch the pull request into a local branch
git fetch origin pull/5/head:pr-5
# Then, check out that branch
git checkout pr-5Identify a record that would be affected by the changes in the pr in your ArchivesSpace development instance and note its resource_id and the repository it is part of.
The arcflow script has been modified to process individual records. You can run the script with the repository ID and the specific resource ID you identified.
Here is an example command. You will need to replace the placeholders with the actual values for your development environment.
python3 -m arcflow --host YOUR_ASPACE_HOST --user YOUR_ASPACE_USER --password YOUR_ASPACE_PASSWORD process --repo_id YOUR_REPO_ID --resource_id YOUR_RESOURCE_ID-
YOUR_ASPACE_HOST: The base URL of your ArchivesSpace backend (e.g.,http://localhost:8089). -
YOUR_ASPACE_USER: Your ArchivesSpace username. -
YOUR_ASPACE_PASSWORD: Your ArchivesSpace password. -
YOUR_REPO_ID: The numeric ID of the repository containing your test record. -
YOUR_RESOURCE_ID: The numeric ID of the resource record you want to test.
This command will:
- Connect to your ArchivesSpace instance.
- Fetch the specified resource.
- Generate an EAD XML file for it.
- The new logic will fetch the creator's biographical note and inject it into the XML.
After the script runs, it will create an XML file in the xml_out directory (or a directory you specify). Open the EAD XML file corresponding to your test record.
Look inside the <archdesc> section. You should find a new <bioghist> element immediately after the </did> tag. This element should contain the biographical/historical note from the creator's agent record, with the content wrapped in <p> tags.
Example of what to look for in the XML:
...
</did>
<bioghist><p>This is the biographical note from the creator agent.</p></bioghist>
...This process allows you to isolate the test to a single record and confirm that the new functionality works as expected.