-
Notifications
You must be signed in to change notification settings - Fork 1
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
Pipeline common tests #36
Conversation
From what i understand, the problem is that concrete implementations of I think you could make it generic, if you really want to decouple it. Example for
// Add some constraints?
interface GenericConfig
interface PipelinePull<T : GenericConfig> {
...
// Make config generic
fun setupConnection(config: T)
...
}
data class PeerConnectionInformation(
val host: String,
val isBind: Boolean
) : GenericConfig
class PipelinePullZMQ : PipelinePull<PeerConnectionInformation> {
// The type signature of the concrete class has the
// concrete implementation of the necessary config
override fun setupConnection(config: PeerConnectionInformation) {
when (config.isBind) {
true -> socket.bind(config.host)
false -> socket.connect(config.host)
}
}
...
} |
Achieved 50% Branch and 70% line coverage, |
I think |
I will fix this |
...mon/src/integrationTest/kotlin/nl/tudelft/hyperion/pipeline/AbstractPluginIntegrationTest.kt
Outdated
Show resolved
Hide resolved
...mon/src/integrationTest/kotlin/nl/tudelft/hyperion/pipeline/AbstractPluginIntegrationTest.kt
Outdated
Show resolved
Hide resolved
...mon/src/integrationTest/kotlin/nl/tudelft/hyperion/pipeline/AbstractPluginIntegrationTest.kt
Outdated
Show resolved
Hide resolved
...mon/src/integrationTest/kotlin/nl/tudelft/hyperion/pipeline/AbstractPluginIntegrationTest.kt
Outdated
Show resolved
Hide resolved
pipeline/common/src/main/kotlin/nl/tudelft/hyperion/pipeline/AbstractPipelinePlugin.kt
Outdated
Show resolved
Hide resolved
pipeline/common/src/main/kotlin/nl/tudelft/hyperion/pipeline/connection/PipelinePullZMQ.kt
Show resolved
Hide resolved
pipeline/common/src/main/kotlin/nl/tudelft/hyperion/pipeline/connection/PipelinePush.kt
Outdated
Show resolved
Hide resolved
pipeline/common/src/main/kotlin/nl/tudelft/hyperion/pipeline/connection/PipelinePullZMQ.kt
Outdated
Show resolved
Hide resolved
pipeline/common/src/main/kotlin/nl/tudelft/hyperion/pipeline/connection/PipelinePush.kt
Outdated
Show resolved
Hide resolved
...ne/common/src/main/kotlin/nl/tudelft/hyperion/pipeline/connection/PluginManagerConnection.kt
Outdated
Show resolved
Hide resolved
It seems you used colons ( Should we decide on a convention to use for documentation? I don't really mind really |
…/monitoring-aware-ides into pipeline-common-tests
pipeline/common/src/main/kotlin/nl/tudelft/hyperion/pipeline/connection/PipelinePushZMQ.kt
Outdated
Show resolved
Hide resolved
pipeline/common/src/main/kotlin/nl/tudelft/hyperion/pipeline/connection/PipelinePullZMQ.kt
Outdated
Show resolved
Hide resolved
|
...mon/src/integrationTest/kotlin/nl/tudelft/hyperion/pipeline/AbstractPluginIntegrationTest.kt
Outdated
Show resolved
Hide resolved
...mon/src/integrationTest/kotlin/nl/tudelft/hyperion/pipeline/AbstractPluginIntegrationTest.kt
Outdated
Show resolved
Hide resolved
settings.gradle.kts
Outdated
@@ -8,6 +8,9 @@ include("plugin") | |||
include("pluginmanager") | |||
include("pipeline") | |||
include("pipeline:common") | |||
include("pipeline:plugins:extractor") | |||
include("pipeline:plugins:pathextractor") | |||
include("pipeline:plugins:renamer") | |||
include("pipeline:plugins:renamer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamer is included twice.
Did a refactor which allows for dependency injection.
The
PipelinePush
andPipelinePull
interfaces usePeerConnectionInformation
to represent the config data required to set up a connection. The goal of these interfaces is to abstract away connection (ZMQ) specific behavior, since other connection implementations may require a different implementation ofPeerConnectionInformation
the current proposed refactor is not satisfying. How can this config be completely decoupled from the concrete connection Implementation?