Comments (9)
There is nothing specific in osgi-test for code coverage. I assume you would need to use some existing test coverage tool like jacoco or something. @kriegfrj may be know more here.
As for interactive debugging, I use Bndtools which has a "Bnd OSGi Test Launcher" Run/Debug option which you can use on the bndrun files and then run/debug your tests.
from osgi-test.
Unfortunately bndtools is an eclipse only thing. I am currently running the debugger with this in my test-debug.bndrun file:
-include=./test.bndrun
-runjdb: 10001
then I have to fire up the remote JVM debugger in intellij. This is not a convenient workflow.
I think that what is needed is an implementation of a gradle TestFramework, that could be configured with a bndrun file.
I think this would also allow one to run a specific test method and not the entire test suite. Additionally, I believe it would solve the problem of having to create a whole separate integration project, because the TestFramework should receive the actual classes and methods that it needs to run.
Thanks for your consideration.
from osgi-test.
I think that what is needed is an implementation of a gradle TestFramework, that could be configured with a bndrun file.
Why not use the TestOSGi
gradle task type? https://github.com/bndtools/bnd/tree/master/gradle-plugins#create-a-task-of-the-testosgi-type
As TestFramework is an internal Gradle type, I don't see Bnd Gradle plugins making use of it.
from osgi-test.
I do use the TestOSGi like this:
I have a separate debug task that use the -jdb, otherwise it will get hung up in CI builds.
val resolveTask = tasks.register<aQute.bnd.gradle.Resolve>("resolve") {
dependsOn(tasks.compileTestJava)
description = "Resolve test.bndrun"
group = "test"
bundles.from(configurations.testRuntimeClasspath)
bndrun.set(file("test.bndrun"))
outputBndrun.set(layout.buildDirectory.file("test.bndrun"))
}
val testOSGiTask = tasks.register<aQute.bnd.gradle.TestOSGi>("testOSGi") {
dependsOn(resolveTask)
description = "OSGi Test test.bndrun"
group = "test"
bndrun.set(resolveTask.flatMap { it.outputBndrun })
}
val debugResolveTask = tasks.register<aQute.bnd.gradle.Resolve>("debugResolve") {
dependsOn(resolveTask)
description = "Resolve test.bndrun"
group = "test"
bndrun.set(file("test-debug.bndrun"))
outputBndrun.set(layout.buildDirectory.file("test-debug.bndrun"))
}
val debugTestOSGiTask = tasks.register<aQute.bnd.gradle.TestOSGi>("debugTestOSGi") {
println("to find an existing java debug listening on a port use the following command")
println("netstat -vanp tcp | grep 10001")
dependsOn(debugResolveTask)
// always run
outputs.upToDateWhen { false }
description = "OSGi Test test-debug.bndrun"
group = "test"
bndrun.set(debugResolveTask.flatMap { it.outputBndrun })
}
It is unfortunate that it is an internal type. :-(.
I guess I will look at maybe implementing an intellij plugin that can provide a junit platform launcher.
@bjhargrave is there a bnd gradle task that will generate a workspace, that will take a configuration. Also is there a way to specify a workspace within the bndrun file?
from osgi-test.
is there a bnd gradle task that will generate a workspace, that will take a configuration.
No.
Also is there a way to specify a workspace within the bndrun file?
Normally, in a non-Bnd workspace model build like gradle, there is no Bnd Workspace and the bndrun file will be provisioned with a "standalone" workspace. What do you need from a Bnd Workspace?
from osgi-test.
Also is there a way to specify a workspace within the bndrun file?
Normally, in a non-Bnd workspace model build like gradle, there is no Bnd Workspace and the bndrun file will be provisioned with a "standalone" workspace. What do you need from a Bnd Workspace?
I am trying to use eclipse, now. The right click run BND OSGi test launcher fails, because I don't have a workspace. I would like to generate one based on the gradle configurations, instead of manually building one.
from osgi-test.
So I imported the gradle example project in this repo into an Eclipse workspace and Bnd launcher fails. Bndtools need more work to support launching bndrun files in a plain gradle project. We did work for maven support in the Bndtools m2e feature. I guess we need to do similar work for gradle to integrate with Buildship. You can open an issue in the bndtools/bnd repo to note this missing support.
from osgi-test.
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.
from osgi-test.
This issue has been automatically closed due to inactivity. If you can reproduce this or if you have a good use case for this feature, please feel free to reopen the issue with steps to reproduce, a quick explanation of your use case or a high-quality pull request.
from osgi-test.
Related Issues (20)
- [assertj] Meta-assertions for bundles HOT 2
- Release 1.1.0 HOT 3
- [junit5] Simplify injector code
- [junit5] InstalledBundleExtension sanity checking
- Do not substitutably import the org.osgi.test.common.annotation package in junit5 HOT 9
- [ServiceExtension] Tweak wildcard type inferencing for upper bounds HOT 6
- [ServiceExtension] Type compatibility check for @InjectService.service() HOT 5
- [InjectingExtension] Refactoring suggestions HOT 10
- Add some descriptive documentation HOT 6
- osgi-test-example-mvn / org.osgi.test.example.player.test.PlayerTest are not executed HOT 4
- Service instance are kept between different BundleContext's, Tests and test Classes HOT 4
- Provide a Junit5 Extension to start an OSGi-Connect-Framework as part of the test without any need for special setup HOT 4
- @ServiceSource should give a meaningfull error if no services are found HOT 3
- @ServiceSource should support ServiceAware<ServiceType> HOT 4
- readme link to codeql broken HOT 2
- NPE with @WithFactoryConfiguration HOT 15
- [cm] Support Systemproperties in Property HOT 4
- [cm] either create unbound config, or provide an option for it. HOT 3
- Weird behaviour when using `ConfigurationExtension` and standard config files HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osgi-test.