Hi,

I have in fact already used org.apache.sling.testing.osgi-mock when testing the 
new feature in oak-store-composite. However, after manually validating using 
AEM Quickstart, I have discovered bugs which were not caught by my tests using 
MockOsgi, especially around binding values from configuration files to 
@Property or @AttributeDefinition fields. AFAIK, MockOsgi does not support 
reading & binding “.cfg.json” or “.config” files.

MockOsgi is great for unit or component tests, but it seems, at least to me, 
quite easy to make wrong assumptions about how OSGi components are activated 
and wired together when writing tests involving several components. I would 
like to have integration tests running in a real OSGi framework to feel more 
confident that the code will run without issues in the real thing. I have quite 
some experience in writing libraries for Spring Boot: I often write integration 
tests which start a Spring Boot container to ensure that all the Spring-enabled 
features of the library are correctly injected & wired together.

Up until now, I have used AEM Quickstart to manually test Oak changes, but the 
roundtrip is very slow, cumbersome, and frustrating... That’s the reason I 
would like to implement these automated OSGi integration tests inside the Oak 
repository itself. There are other future changes in oak-segment-azure I will 
soon start working on, which would also benefit from this kind of integration 
tests.

If there is a better way to achieve the same confidence using just MockOsgi 
(and at the same time removing the need to validate through AEM Quickstart), 
then I’m very interested to learn about it.

Regards,

Carlo


From: Angela Schreiber <[email protected]>
Date: Tuesday, 18 January 2022 at 16:04
To: [email protected] <[email protected]>
Subject: Re: Oak-it-osgi module
Hi Carlo

In the various security related modules I used 
org.apache.sling.testing.osgi-mock to test the OSGi setup.
I never used oak-it-osgi as a base for tests.

Kind regards
Angela


________________________________
From: Carlo Jelmini <[email protected]>
Sent: Tuesday, January 18, 2022 3:54 PM
To: [email protected] <[email protected]>
Subject: Re: Oak-it-osgi module

Hi Angela,

I agree with the idea. However, what is then the best approach to add OSGi 
integration tests in other modules, without duplicating the Pax-Exam setup? 
Does it make sense to use oak-it-osgi as a test dependency (using the “tests” 
classifier)?

Regards,
Carlo

From: Angela Schreiber <[email protected]>
Date: Tuesday, 18 January 2022 at 08:43
To: [email protected] <[email protected]>
Subject: Re: Oak-it-osgi module
Hi Carlo

The oak-it-osgi module is IMHO not particularly well maintained and I would 
rather add the tests to the very modules the belong to.

Kind regards
Angela




________________________________
From: Carlo Jelmini <[email protected]>
Sent: Monday, January 17, 2022 4:15 PM
To: [email protected] <[email protected]>
Subject: Oak-it-osgi module

Hi,

I’m looking for a good place to add integration tests for the issue “Enable 
configuration of more than one read-only mount in the composite node store“[0] 
and I think the module “oak-it-osgi” is the best candidate.

However, I’m surprised to see that, with the current maven-failsafe-plugin 
configuration, the integration tests are not executed by Maven. Moreover, when 
enabling execution, the tests fail to start the forked OSGi container. Lastly, 
most tests just print to the console, without any assertions.

I have fixed all the above-mentioned issues and I could submit a PR, but now I 
wonder if the module is still maintained or whether I’m misunderstanding its 
purpose.
Is it ok if the integration tests from this module are executed, with actual 
assertions, on each build? Should I then submit my fixes?
If this module is not the right place, where should I move my integration tests 
which validate OSGi configurations for multiple mounts with composite node 
store?

Thanks,

Carlo

[0] 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FOAK-9553&amp;data=04%7C01%7Cjelmini%40adobe.com%7C6f6a81fbbb1f494546db08d9da93d39b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637781150717574598%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=v%2BoF5scBbGDvJs73gzpJ8Q4cTNU7s8wZ%2FShYvMYVd7o%3D&amp;reserved=0

Reply via email to