Community
Participate
Working Groups
When I'm running the following tests, stack traces appear in the console. Is this expected? I'm afraid that we are getting exceptions that are not propagated and the tests pass where they should fail. ArtifactMirrorApplicationTest [line: 405] - testArtifactMirrorToPartialDuplicateWithAppend() ArtifactMirrorApplicationTest [line: 439] - testArtifactMirrorToPopulatedWithFullDuplicateWithAppend() ArtifactMirrorApplicationTest [line: 473] - testArtifactMirrorToPopulatedWithPartialDuplicateWithAppend() ArtifactMirrorApplicationTest [line: 640] - testArtifactMirrorSourceIsDestination() ArtifactMirrorApplicationTest [entry] - testArtifactMirrorToFullDuplicateWithAppend()
Here's what I have so far: -The stack traces only occur with tests where "-append" is present and only after the repo is populated. - the mirror method calls getOutputStream which checks if the descriptor passed to it is already in the repository. If it is then it throws a ProvisionException which is then caught and printed as a stack trace with the comment "//TODO is it OK to ignore this result?" -The "Artifact repository out of sync" message is only displayed if a file exists on disk but is not actually in the repository. So if an artifact is already in the repository we throw an error and move on to the next descriptor. If the file exists on disk but the repository doesn't have any knowledge of it then the file is deleted and the new one is downloaded. Do we make the assumption that if a descriptor is in a repository it is correct and not overwrite it, assume it is outdated and overwrite it, or create a new preference that lets the use choose which behaviour they want?
Created attachment 115179 [details] Stops stack tracing from printing, uses IStatus returned from getRawArtifact Changes exceptions thrown in Mirroring#mirror to returned statuses which are processed in MirrorApplication. Adds new arguements "verbose" which makes the application verbose and "ignoreErrors" which allows the application to continue even if an exception occurs. Changed ArtifactMirrorApplicationTest to use these arguments.
Comment this patch may solve Bug 250204
I have made changes to the code and released it but I will leave this open until we have regression tests for the new command-line args.
(In reply to comment #4) > I have made changes to the code and released it but I will leave this open > until we have regression tests for the new command-line args. > Currently they only print to the console. Is there an automated way to verify the console contents? All the test cases currently have "-verbose" included by default.
Not sure but minimally we need to call the application with all variants of the arguments to ensure that all code paths are taken.
Created attachment 115843 [details] Adds test to test precense of new arguements I'm not really too happy with these 2 test cases but they're a start. To truly verify the effect of "-verbose" I'd need to be able to read what's printed to the console or a log file. Similarly to properly test the "-ignoreErrors" argument I'd need a repo that is known to throw an error during mirroring that I'm not quick sure how to build. I'd welcome any advice.
Changing the target milestone as we are not contributing to M3. However please make sure these bugs are addressed early in M4 or tomorrow Testing Thursday for the test related ones.
Created attachment 117435 [details] Adds test case to ensure ingoreErrors is respected Uses attached test data. This test runs the mirror application on a repository with an artifact in the xml but not on disk. the expected result is the remaining artifacts are mirrored correctly. Unfortunately, because the order in which an artifact is mirrored is not consistent, I cannot test the absence of this argument.
Created attachment 117436 [details] Adds test data known to throw an error For use with the previously attached test case.
Thx. Test released.