Project overview (SLING-1437)
The goal of this Google Summer of Code project is to create more unit and integration tests for Sling, as well as measure the test coverage that the combination of unit and integration tests provide. Petr Shypila has been accepted to work on it, mentored by Bertrand Delacretaz.
Weekly 3P reports
The 3P are:
Progress: what concrete work (code etc.) has been accomplished since the last report.
Problems: anything that has significantly slowed progress or is expected to do so going forward. Do not disclose anything personal or confidential here of course, such issues can be reported directly to your mentor as appropriate.
Perspectives: what progress is expected for the next period and later.
May 24th 3P report
Progress: started to write first unit tests for commons.schedule module.
|JIRA Issue||- SLING-4735Getting issue details... STATUS|
|Github pull request||https://github.com/apache/sling/pull/91|
UPD 05/27/2015 Updated Version
Code coverage at the beginning
|Code coverage at the end of the week||50%|
UPD 05/27/2015 72%
- How to inject service if it defined as a private field. Only with reflection?
- I’ve tried to launch a test with @RunWith(SlingAnnotationsTestRunner.class)
annotation to inject BundleContext with @TestReference annotation.
But it doesn’t work for in my case. Does it injects only org.osgi.*
bundles or any other Sling service too?
- I have created a test issue in JIRA for my current iteration. But I don’t see
there a Assign To action. Is this okay?
- Which kind of tests I can do with:
- SettingsSupport - has only two simple methods.
- WhiteboardHandler - contains some private methods, which are used in other anonymous class. Also get this object with reflection and then test it?
- Looks like there is no sense to cover with tests SchedulerServiceFactory since it is just a wrapper above QuartzScheduler which is already tested.
In this week I plan to finish scheduler module and start to work on a new one.
What do you think about commons.threads?
I suggest starting with SLING-4757, we can look at commons.threads later.
May 31th 3P report
Progress: Finished tests for commons.schedule module. Finished unit tests for commons.contentdetection module.
Started to write integration tests for commons.contentdetection module.
I think the only problem is that for next two weeks I have a lot of exams in my university. Most of them are pretty easy. But I can't ignore them at all.
On week June 1st - 7th I have one exam on Monday and another one on Friday(Both are easy). So it will affect my productivity a bit, but not too much.
I can cover some other modules with integration or unit tests, for example SLING-4541.
Thanks for your report and for your work! SLING-4541 looks good as the next step, based on the experiences done with SLING-4757.
You don't need to attach your patches here, mentioning the JIRA issue numbers is sufficient.
Don't let GSoC ruin your exams, it's fine with me if you do less GSoC hours in the next two weeks and come back to your usual schedule after that.
June 7th 3P report
Progress: I covered with 100% internal.PathEntry class and improved up to 20% coverage of internal.DefaultContentCreator. Unfortunately I'm not quite satisfied with the result which I provide. It took some time to choose which approach should I use to write tests for this module. First time I tried to use JCR Mocks, unlikely(as I see), it doesn't provide enough functionality to do that, because there are still some required methods which are not implemented yet. So after that I switched to use JMock and since I didn't work with it before it also took time to understand how it works. So I will be happy to get some code review summary of my tests. Probably there is some better way to tests this module.
This Monday starts me second week with exams in a university.
I plan to continue write new unit tests for this module.
Thanks for your report, I'll have a look at your tests and might suggest some alternative techniques - it's also fairly easy to get a JCR repository to run tests, even without setting up an OSGi framework, that might be an option here.
June 14th 3P report
Progress: I have covered with tests 3 methods of DefaultContentCreator using JCR Repository provider. New patch(week-3.patch) is also attached in a JIRA ticket.
Everything seems okay.
I plan to continue write new unit tests for DefaultContentCreator class.
Looks good, thanks! I'll have a look at your SLING-4151 patches hopefully today.
June 21th 3P report
Progress: Almost covered with tests DefaultContentCreator class and improved test coverage of ContentLoaderService up to 68%
Everything seems okay.
I plan to write few simple tests for DefaultContentCreator and concentrate on BundleContentLoader class.
Thanks! I'll have a look at your patches today.
June 28th 3P report
Covered with unit tests DefaultContentImporter and wrote integration tests for whole module.
Started to work with bundles/engine module. Could you please create a JIRA issue for that?
Submitted evaluation question on Google-Melange
Everything seems okay.
I plan to cover with unit tests bundles/engine module.