Skip to content

Offline unit tests for GzippedJsonDownloaderTest and JsonDownloaderTest #9699

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

Closed
wants to merge 1 commit into from

Conversation

tlk
Copy link
Contributor

@tlk tlk commented Jan 31, 2020

Running cd app; ant test on the master branch results in test errors. I noticed these errors after applying #9698 but they were also present before, only less noticeable:

[junit] Running cc.arduino.contributions.GzippedJsonDownloaderTest
[junit] Problem getting data folder: Error getting the Arduino data folder.
[junit] java.lang.NullPointerException
[junit]     at processing.app.BaseNoGui.getSettingsFolder(BaseNoGui.java:300)
[junit]     at cc.arduino.utils.network.FileDownloaderCache.<clinit>(FileDownloaderCache.java:82)
[junit]     at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:167)
[junit]     at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:129)
[junit]     at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:147)
[junit]     at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:130)
[junit]     at cc.arduino.contributions.JsonDownloader.download(JsonDownloader.java:49)
[junit]     at cc.arduino.contributions.GZippedJsonDownloader.download(GZippedJsonDownloader.java:63)
[junit]     at cc.arduino.contributions.GzippedJsonDownloaderTest.testJsonDownload(GzippedJsonDownloaderTest.java:43)
[junit]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[junit]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[junit]     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
[junit]     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[junit]     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
[junit]     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[junit]     at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
[junit]     at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
[junit]     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
[junit]     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
[junit]     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
[junit]     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
[junit]     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
[junit]     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
[junit]     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
[junit]     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
[junit]     at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
[junit]     at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38)
[junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:534)
[junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1196)
[junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1041)
[junit] Running cc.arduino.contributions.GzippedJsonDownloaderTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec
[junit] Test cc.arduino.contributions.GzippedJsonDownloaderTest FAILED (crashed)
[junit] Running cc.arduino.contributions.JsonDownloaderTest
[junit] Problem getting data folder: Error getting the Arduino data folder.
[junit] java.lang.NullPointerException
[junit]     at processing.app.BaseNoGui.getSettingsFolder(BaseNoGui.java:300)
[junit]     at cc.arduino.utils.network.FileDownloaderCache.<clinit>(FileDownloaderCache.java:82)
[junit]     at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:167)
[junit]     at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:129)
[junit]     at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:147)
[junit]     at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:130)
[junit]     at cc.arduino.contributions.JsonDownloader.download(JsonDownloader.java:49)
[junit]     at cc.arduino.contributions.JsonDownloaderTest.testJsonDownload(JsonDownloaderTest.java:42)
[junit]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[junit]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[junit]     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
[junit]     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[junit]     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
[junit]     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[junit]     at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
[junit]     at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
[junit]     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
[junit]     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
[junit]     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
[junit]     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
[junit]     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
[junit]     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
[junit]     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
[junit]     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
[junit]     at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
[junit]     at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38)
[junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:534)
[junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1196)
[junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1041)
[junit] Running cc.arduino.contributions.JsonDownloaderTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec
[junit] Test cc.arduino.contributions.JsonDownloaderTest FAILED (crashed)

This PR resolves existing test errors 🎉

Cons

  • adds 12M test data to the git repo

Pros

  • no longer necessary to download 12M test data on each test run

If these tests were intended to test actual data download then this PR should probably be dropped.

However, if the intention was to test deserialization of JSON data (which I believe it looks like) then perhaps these tests could be renamed in another PR to clarify the intent.


All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open [Pull Requests]

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you lint your code locally prior to submission?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes

@cmaglie
Copy link
Member

cmaglie commented Feb 6, 2020

Looking at what's happening to the arm32 JRE and SSL at this point I'd like to keep the download...
I think I know why it's failing I'll prepare a PR shortly.

@cmaglie
Copy link
Member

cmaglie commented Feb 6, 2020

superseded by #9727

@cmaglie cmaglie closed this Feb 6, 2020
@per1234 per1234 added Type: Bug Type: Duplicate Another item already exists for this topic labels Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Type: Duplicate Another item already exists for this topic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants