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

fix: NullPointerExceptions in /api/mydata/retrieve #9581

Merged
merged 6 commits into from
May 10, 2024

Conversation

vera
Copy link
Contributor

@vera vera commented May 8, 2023

What this PR does / why we need it:

While using the API endpoint api/v1/mydata/retrieve (which btw is not documented, I hope that doesn't mean it's not supposed to be used? :)) I encountered two NullPointerExceptions which this PR fixes:

dev_dataverse> [#|2023-05-08T09:33:29.596+0000|SEVERE|Payara 5.2022.4|edu.harvard.iq.dataverse.api.errorhandlers.ThrowableHandler|_ThreadID=123;_ThreadName=http-thread-pool::http-listener-1(1);_TimeMillis=1683538409596;_LevelValue=1000;|
dev_dataverse>   _status="ERROR";_code=500;_message="Internal server error. More details available at the server logs.";_incidentId="3d2aa6c1-a623-41f5-9410-4709c2ab3bd1";_interalError="NullPointerException";_requestUrl="http://localhost:8080/api/v1/mydata/retrieve?selected_page=1&dvobject_types=Dataverse&dvobject_types=Dataset&published_states=Published&published_states=Unpublished&published_states=Draft&published_states=In%20Review&published_states=Deaccessioned&role_ids=1&role_ids=2&role_ids=3&role_ids=4&role_ids=5&role_ids=6&role_ids=7&role_ids=8&mydata_search_term=";_requestMethod="GET"||#]
dev_dataverse> 
dev_dataverse> [#|2023-05-08T09:33:29.595+0000|SEVERE|Payara 5.2022.4||_ThreadID=123;_ThreadName=http-thread-pool::http-listener-1(1);_TimeMillis=1683538409595;_LevelValue=1000;|
dev_dataverse>   java.lang.NullPointerException
dev_dataverse> 	at edu.harvard.iq.dataverse.search.SolrSearchResult.getJsonForMyData(SolrSearchResult.java:436)
dev_dataverse> 	at edu.harvard.iq.dataverse.mydata.DataRetrieverAPI.formatSolrDocs(DataRetrieverAPI.java:484)
dev_dataverse> 	at edu.harvard.iq.dataverse.mydata.DataRetrieverAPI.retrieveMyDataAsJsonString(DataRetrieverAPI.java:418)
dev_dataverse> 	at jdk.internal.reflect.GeneratedMethodAccessor241.invoke(Unknown Source)
dev_dataverse> 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
dev_dataverse> 	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:134)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:177)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:81)
dev_dataverse> 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475)
dev_dataverse> 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397)
dev_dataverse> 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
dev_dataverse> 	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
dev_dataverse> 	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
dev_dataverse> 	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
dev_dataverse> 	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
dev_dataverse> 	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
dev_dataverse> 	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
dev_dataverse> 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
dev_dataverse> 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:311)
dev_dataverse> 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
dev_dataverse> 	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1637)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:331)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:282)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at edu.harvard.iq.dataverse.api.ApiBlockingFilter.doFilter(ApiBlockingFilter.java:169)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at edu.harvard.iq.dataverse.api.ApiRouter.doFilter(ApiRouter.java:30)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
dev_dataverse> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:167)
dev_dataverse> 	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:757)
dev_dataverse> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:577)
dev_dataverse> 	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
dev_dataverse> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:158)
dev_dataverse> 	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:372)
dev_dataverse> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:239)
dev_dataverse> 	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
dev_dataverse> 	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
dev_dataverse> 	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
dev_dataverse> 	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
dev_dataverse> 	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:201)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
dev_dataverse> 	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
dev_dataverse> 	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
dev_dataverse> 	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
dev_dataverse> 	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
dev_dataverse> 	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
dev_dataverse> 	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
dev_dataverse> 	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
dev_dataverse> 	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
dev_dataverse> 	at java.base/java.lang.Thread.run(Unknown Source)
dev_dataverse> |#]
  1. (encountered after fixing the first one)
dev_dataverse> [#|2023-05-08T09:43:21.932+0000|SEVERE|Payara 5.2022.4|edu.harvard.iq.dataverse.api.errorhandlers.ThrowableHandler|_ThreadID=224;_ThreadName=http-thread-pool::http-listener-1(6);_TimeMillis=1683539001932;_LevelValue=1000;|
dev_dataverse>   _status="ERROR";_code=500;_message="Internal server error. More details available at the server logs.";_incidentId="4c32fad2-479d-493e-897d-ada5776d45a0";_interalError="NullPointerException";_requestUrl="http://localhost:8080/api/v1/mydata/retrieve?selected_page=1&dvobject_types=Dataverse&dvobject_types=Dataset&published_states=Published&published_states=Unpublished&published_states=Draft&published_states=In%20Review&published_states=Deaccessioned&role_ids=1&role_ids=2&role_ids=3&role_ids=4&role_ids=5&role_ids=6&role_ids=7&role_ids=8&mydata_search_term=";_requestMethod="GET"||#]
dev_dataverse> 
dev_dataverse> [#|2023-05-08T09:43:21.938+0000|SEVERE|Payara 5.2022.4|edu.harvard.iq.dataverse.api.errorhandlers.ThrowableHandler|_ThreadID=224;_ThreadName=http-thread-pool::http-listener-1(6);_TimeMillis=1683539001938;_LevelValue=1000;|
dev_dataverse>   java.lang.NullPointerException
dev_dataverse> 	at edu.harvard.iq.dataverse.mydata.DataRetrieverAPI.formatSolrDocs(DataRetrieverAPI.java:486)
dev_dataverse> 	at edu.harvard.iq.dataverse.mydata.DataRetrieverAPI.retrieveMyDataAsJsonString(DataRetrieverAPI.java:418)
dev_dataverse> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
dev_dataverse> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
dev_dataverse> 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
dev_dataverse> 	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:134)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:177)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219)
dev_dataverse> 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:81)
dev_dataverse> 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475)
dev_dataverse> 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397)
dev_dataverse> 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
dev_dataverse> 	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
dev_dataverse> 	at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
dev_dataverse> 	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
dev_dataverse> 	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
dev_dataverse> 	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
dev_dataverse> 	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
dev_dataverse> 	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
dev_dataverse> 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
dev_dataverse> 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:311)
dev_dataverse> 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
dev_dataverse> 	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1637)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:331)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:282)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at edu.harvard.iq.dataverse.api.ApiBlockingFilter.doFilter(ApiBlockingFilter.java:169)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at edu.harvard.iq.dataverse.api.ApiRouter.doFilter(ApiRouter.java:30)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
dev_dataverse> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
dev_dataverse> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
dev_dataverse> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:167)
dev_dataverse> 	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:757)
dev_dataverse> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:577)
dev_dataverse> 	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
dev_dataverse> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:158)
dev_dataverse> 	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:372)
dev_dataverse> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:239)
dev_dataverse> 	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
dev_dataverse> 	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
dev_dataverse> 	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
dev_dataverse> 	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
dev_dataverse> 	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:201)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
dev_dataverse> 	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
dev_dataverse> 	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
dev_dataverse> 	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
dev_dataverse> 	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
dev_dataverse> 	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
dev_dataverse> 	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
dev_dataverse> 	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
dev_dataverse> 	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
dev_dataverse> 	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
dev_dataverse> 	at java.base/java.lang.Thread.run(Unknown Source)
dev_dataverse> |#]

Which issue(s) this PR closes:

none

Special notes for your reviewer:

Suggestions on how to test this:

Unfortunately, I am not sure precisely in what situation the entity is null, since I encountered these exceptions while just playing around with the API

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

no

Is there a release notes update needed for this change?:

no

Additional documentation:

@pdurbin
Copy link
Member

pdurbin commented May 9, 2023

@vera I'd say we're having trouble deciding whether or not to make the MyData API official: 😅

Thanks for the pull request!

There are some tests in DataRetrieverApiIT but it hasn't been added to tests/integration-tests.txt (not sure why) which means they aren't being executed on Jenkins.

Are you set up to run IT (integration) tests? If so, do you want to try running those?

You could also simply DataRetrieverApiIT to tests/integration-tests.txt to see what happens! 😄

@qqmyers
Copy link
Member

qqmyers commented May 9, 2023

FWIW: From

// Check if the search result ("card") contains an entity, before
// attempting to convert it to a Dataset. It occasionally happens that
// solr has indexed datasets that are no longer in the database. If this
// is the case, the entity will be null here; and proceeding any further
// results in a long stack trace in the log file.
if (result.getEntity() == null) {
return null;
}
which makes the same call to getEntity(), it appears that null can indicate a database issue (something indexed that is no longer in the database).

@vera
Copy link
Contributor Author

vera commented May 10, 2023

@pdurbin I tried running the integration tests as described here: https://guides.dataverse.org/en/latest/developers/testing.html

Unfortunately I seem to need some help to get this working... Running this command conf/docker-aio/run-test-suite.sh http://localhost:8080, I get "Tests run: 129, Failures: 6, Errors: 114, Skipped: 6" with a lot of "Connection refused" errors for some reason, e.g.

[ERROR] edu.harvard.iq.dataverse.api.UsersIT.testMergeAccounts  Time elapsed: 0.013 s  <<< ERROR!
java.net.ConnectException: Connection refused (Connection refused)
	at edu.harvard.iq.dataverse.api.UsersIT.testMergeAccounts(UsersIT.java:107)

Running mvn test, I get "[WARNING] Tests run: 1511, Failures: 0, Errors: 0, Skipped: 10", but it doesn't seem to be running the DataRetrieverApiIT tests since I couldn't find any mention of it in the test report. Not sure what tests/integration-tests.txt does but adding it there also didn't seem to make a difference.

I am running Dataverse on localhost:8080 using the new dev docker container btw.

@qqmyers Interesting. I didn't manipulate the database or the index, but I did use api/datasets/<id>/destroy to get rid of some test datasets.

@pdurbin
Copy link
Member

pdurbin commented May 10, 2023

Not sure what tests/integration-tests.txt does but adding it there also didn't seem to make a difference.

Ah, sorry, I mean if you add it there, then Jenkins will run it. In those docs you found we say this:

If you are adding a new test class, be sure to add it to tests/integration-tests.txt so that our automated testing knows about it.

Just above there are example of only running one or two of those classes at a time: https://guides.dataverse.org/en/latest/developers/testing.html#writing-api-tests-with-rest-assured

@vera vera force-pushed the fix-api-mydata-retrieve-npe branch from 542ffd2 to 37f6fc1 Compare May 10, 2023 12:59
@vera
Copy link
Contributor Author

vera commented May 10, 2023

I see, thanks. Running it with -Dtest worked. I've added it to the .txt as well.

@pdurbin
Copy link
Member

pdurbin commented May 10, 2023

@vera awesome, thanks. I know you can't see this because a firewall is blocking your IP address but the test you added is passing: https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-9581/3/testReport/edu.harvard.iq.dataverse.api/DataRetrieverApiIT/testRetrieveMyDataAsJsonString/

Screen Shot 2023-05-10 at 12 31 42 PM

@johannes-darms
Copy link
Contributor

@vera I'd say we're having trouble deciding whether or not to make the MyData API official: 😅

@pdurbin: I believe this API is needed for the new frontend to implement the view of My items. Would it be possible to merge this simple NPE fix?

@qqmyers
Copy link
Member

qqmyers commented Nov 13, 2023

Looks like the pretty printing change we discussed at standup (which hasn't been merged yet) - because the test here checks the text instead of the json, the fact that the our prettyprint adds a \n that doesn't happen with gson would cause a failure like this. Perhaps the test here, which was just turned on, was written prior to an earlier prettyprint change.

@pdurbin
Copy link
Member

pdurbin commented Nov 13, 2023

@vera @johannes-darms ok, as long as you're logged into GitHub, you should be able to see the error here: https://github.com/gdcc/api-test-runner/actions/runs/6853346220

Like Jim says it seems to be about pretty printing.

@pdurbin
Copy link
Member

pdurbin commented Nov 15, 2023

@vera can you please resolve the merge conflicts and let us know if you need any help with the pretty printing change?

@coveralls
Copy link

Coverage Status

coverage: 19.996%. remained the same
when pulling 44a4fe0 on vera:fix-api-mydata-retrieve-npe
into 8d8f35f on IQSS:develop.

@vera
Copy link
Contributor Author

vera commented Nov 17, 2023

@pdurbin done, I hope the pretty printing fix is OK

@pdurbin
Copy link
Member

pdurbin commented Nov 17, 2023

@vera thanks! Jenkins tests are still running. I'll keep an eye on them!

Update: tests passed - https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-9581/6/testReport/

@pdurbin pdurbin added the Size: 3 A percentage of a sprint. 2.1 hours. label Feb 28, 2024
@scolapasta
Copy link
Contributor

If you are still interested in this PR, can you please merge and resolve any merge conflicts with the latest from develop? If so, we can prioritize reviewing and QAing the changes. If we don’t hear from you by May 22, 2024, we’ll go ahead and close this PR (it can always be reopened after that date, if there is still interest).

@johannes-darms
Copy link
Contributor

@scolapasta If I'm not mistaken we are waiting for the merge/review to happen.

@pdurbin
Copy link
Member

pdurbin commented Apr 24, 2024

@johannes-darms there are merge conflicts in tests/integration-tests.txt that @scolapasta is asking you to resolve.

# Conflicts:
#	tests/integration-tests.txt
@vera
Copy link
Contributor Author

vera commented Apr 25, 2024

@scolapasta resolved :)

@sekmiller sekmiller self-assigned this May 1, 2024
@sekmiller sekmiller removed their assignment May 1, 2024
@stevenwinship stevenwinship self-assigned this May 10, 2024
@stevenwinship stevenwinship merged commit 798dd5c into IQSS:develop May 10, 2024
11 checks passed
@stevenwinship stevenwinship removed their assignment May 10, 2024
@pdurbin pdurbin added this to the 6.3 milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants