Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "Getting Set Up to Run REST Assured Tests" #9738

Closed
pdurbin opened this issue Jul 26, 2023 · 1 comment · Fixed by #9936
Closed

Update "Getting Set Up to Run REST Assured Tests" #9738

pdurbin opened this issue Jul 26, 2023 · 1 comment · Fixed by #9936
Labels
Feature: Developer Guide Size: 0.5 A percentage of a sprint. 0.35 hours
Milestone

Comments

@pdurbin
Copy link
Member

pdurbin commented Jul 26, 2023

In #9457 we learned that https://guides.dataverse.org/en/5.13/developers/testing.html#getting-set-up-to-run-rest-assured-tests should be updated to at least cover:

I'm leaving a ... above in case we think of anything else. From a run yesterday of the full API test suite against #9685 as of b627319, the harvesting test above was the only one that failed so that might be it. From #9457 (comment) it was this test:

[ERROR] HarvestingServerIT.testMultiRecordOaiSet:606 Wrong number of items on the first ListIdentifiers page expected:<2> but was:<5>

By the way, there is a detailed note in HarvestingServerIT itself but we should update the guides. Here's that note:

// This test will attempt to create a set with multiple records (enough 
// to trigger a paged respons) and test the resumption token functionality). 
// Note that this test requires the OAI service to be configured with some
// non-default settings (the paging limits for ListIdentifiers and ListRecords
// must be set to 2, in order to be able to trigger this paging behavior without
// having to create and export too many datasets).
// So you will need to do this:
//    asadmin create-jvm-options "-Ddataverse.oai.server.maxidentifiers=2"
//    asadmin create-jvm-options "-Ddataverse.oai.server.maxrecords=2"

On a related note, I mentioned in Slack that I maintain a script called dev-rebuild (see #7363) where I automate these things that developers need to get API tests to pass (createsequence.sql comes to mind). It calls setup-all with --insecure to help developers get set up with the right settings. @landreev and briefly discussed (in that thread) that maybe we need a new flag like --api-tests that can be passed for additional setup such as the harvesting settings and the createsequence thing. So that the API tests can pass. Future work. Out of scope for this issue, which is probably a 3 or our new 0.5.

@pdurbin pdurbin added Feature: Developer Guide Size: 0.5 A percentage of a sprint. 0.35 hours labels Jul 26, 2023
@pdurbin
Copy link
Member Author

pdurbin commented Aug 1, 2023

Here's the fix I put in at gdcc/api-test-runner@2e31486

diff --git a/docker-compose-develop.yml b/docker-compose-develop.yml
index 5b7a80c..dcb05a4 100644
--- a/docker-compose-develop.yml
+++ b/docker-compose-develop.yml
@@ -11,6 +11,9 @@ services:
       - DATAVERSE_DB_HOST=postgres
       - DATAVERSE_DB_PASSWORD=secret
       - DATAVERSE_DB_USER=${DATAVERSE_DB_USER}
+      # to get HarvestingServerIT to pass
+      - dataverse_oai_server_maxidentifiers=2
+      - dataverse_oai_server_maxrecords=2
     ports:
       - '8080:8080'
     networks:

HarvestingServerIT.testMultiRecordOaiSet is no longer failing there: https://github.com/pdurbin/dataverse-api-test-runner/actions/runs/5727862514/job/15521203096

Only two failing tests left for the develop branch (as of d9f0952):

Error: HarvestingClientsIT.testHarvestingClientRun:234 Last harvest not reported a success (took 0 seconds) expected:<SUCCESS> but was:<null>

Error: MakeDataCountApiIT.testMakeDataCountGetMetric:61 Expected status code <200> doesn't match actual status code <400>.

For the second one, I'm seeing this when I try to run the test locally against Dataverse running in Docker:

/api/admin/makeDataCount/3/addUsageMetricsFromSushiReport?reportOnDisk=/tmp/sushi_sample_logs.json{"status":"ERROR","message":"IOException: /tmp/sushi_sample_logs.json (No such file or directory)"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Developer Guide Size: 0.5 A percentage of a sprint. 0.35 hours
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant