Skip to content

Commit 31de39d

Browse files
committed
cargo behave fix
disable minifi_rs_playground without ENABLE_TEST_PROCESSORS set CMAKE_LIBRARY_OUTPUT_DIRECTORY for corrosion
1 parent 3f23c26 commit 31de39d

5 files changed

Lines changed: 22 additions & 16 deletions

File tree

minifi_rust/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ FetchContent_Declare(Corrosion
3131

3232
FetchContent_MakeAvailable(Corrosion)
3333

34+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
35+
3436
corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml)
3537

38+
if (NOT ENABLE_TEST_PROCESSORS)
39+
set_target_properties(cargo-build_minifi_rs_playground PROPERTIES EXCLUDE_FROM_ALL TRUE)
40+
endif()
41+
3642
include(CTest)
3743

3844
add_test(
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
@SUPPORTS_WINDOWS
22
Feature: Testing controller service api casting
33

4-
Scenario: Zoo has a jetpack dog and a normal duck
5-
Given a ZooProcessor processor with the "Can fly service" property set to "Wolfie the magical"
6-
And the "Number of Legs Service" property of the ZooProcessor processor is set to "Wolfie the magical"
4+
Scenario: Zoo has a jetpack dog
5+
Given a ZooProcessorRs processor with the "Can fly service" property set to "Wolfie the magical"
6+
And the "Number of Legs service" property of the ZooProcessorRs processor is set to "Wolfie the magical"
77
And a DogController controller service named "Wolfie the magical" is set up and the "Has Jetpack" property set to "true"
88
And the "Extra information" property of the Wolfie the magical controller service is set to "The dog (Canis familiaris or Canis lupus familiaris) is a domesticated descendant of wolves."
99
When the MiNiFi instance starts up
1010

11-
Then the Minifi logs contain the following message: "[minifi_rs_playground::processors::zoo_processor::ZooProcessor] [critical] Can DogController { has_jetpack: true, extra_info: "The dog (Canis familiaris or Canis lupus familiaris) is a domesticated descendant of wolves." } fly? true" in less than 10 seconds
11+
Then the Minifi logs contain the following message: "[minifi_rs_playground::processors::zoo_processor::ZooProcessorRs] [critical] Can DogController { has_jetpack: true, extra_info: "The dog (Canis familiaris or Canis lupus familiaris) is a domesticated descendant of wolves." } fly? true" in less than 10 seconds
1212
And the Minifi logs do not contain errors
1313
And the Minifi logs do not contain warnings
1414

minifi_rust/extensions/minifi_rs_playground/minifi_rs_playground.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ limitations under the License.
2626
- [LogAttributeRs](#LogAttributeRs)
2727
- [LoremIpsumCSUser](#LoremIpsumCSUser)
2828
- [PutFileRs](#PutFileRs)
29-
- [ZooProcessor](#ZooProcessor)
29+
- [ZooProcessorRs](#ZooProcessorRs)
3030
### Controller Services
3131

3232
- [DogController](#DogController)
@@ -255,11 +255,11 @@ In the list below, the names of required properties appear in bold. Any other pr
255255
| success | Flowfiles that are successfully written to a file are routed to this relationship |
256256

257257

258-
## ZooProcessor
258+
## ZooProcessorRs
259259

260260
### Description
261261

262-
Test ZooProcessor
262+
Test ZooProcessorRs
263263

264264
### Properties
265265

@@ -268,7 +268,7 @@ In the list below, the names of required properties appear in bold. Any other pr
268268
| Name | Default Value | Allowable Values | Description |
269269
|----------------------------|---------------|------------------|--------------------------|
270270
| **Can fly service** | | | Test CanFlyService |
271-
| **Number of Legs Service** | | | Test NumberOfLegsService |
271+
| **Number of Legs service** | | | Test NumberOfLegsService |
272272

273273
### Relationships
274274

minifi_rust/extensions/minifi_rs_playground/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::processors::kamikaze_processor::KamikazeProcessorRs;
1414
use crate::processors::log_attribute::LogAttributeRs;
1515
use crate::processors::lorem_ipsum_cs_user::LoremIpsumCSUser;
1616
use crate::processors::put_file::PutFileRs;
17-
use crate::processors::zoo_processor::ZooProcessor;
17+
use crate::processors::zoo_processor::ZooProcessorRs;
1818

1919
use minifi_native::{
2020
ComplexProcessorType, Concurrent, Exclusive, FlowFileSourceProcessorType,
@@ -32,7 +32,7 @@ processors: [
3232
(FlowFileTransformProcessorType, Concurrent, PutFileRs),
3333
(FlowFileStreamTransformProcessorType, Concurrent, AsciifyGerman),
3434
(FlowFileStreamTransformProcessorType, Exclusive, DuplicateStreamText),
35-
(ComplexProcessorType, Concurrent, ZooProcessor),
35+
(ComplexProcessorType, Concurrent, ZooProcessorRs),
3636
],
3737
controllers: [
3838
LoremIpsumControllerService,

minifi_rust/extensions/minifi_rs_playground/src/processors/zoo_processor.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub(crate) const CAN_FLY_SERVICE: Property = Property {
2222
};
2323

2424
pub(crate) const NUMBER_OF_LEGS: Property = Property {
25-
name: "Number of Legs Service",
25+
name: "Number of Legs service",
2626
description: "Test NumberOfLegsService",
2727
is_required: true,
2828
is_sensitive: false,
@@ -34,9 +34,9 @@ pub(crate) const NUMBER_OF_LEGS: Property = Property {
3434
};
3535

3636
#[derive(Debug, ComponentIdentifier)]
37-
pub(crate) struct ZooProcessor {}
37+
pub(crate) struct ZooProcessorRs {}
3838

39-
impl Schedule for ZooProcessor {
39+
impl Schedule for ZooProcessorRs {
4040
fn schedule<Ctx: GetProperty, L: Logger>(
4141
_context: &Ctx,
4242
_logger: &L,
@@ -48,7 +48,7 @@ impl Schedule for ZooProcessor {
4848
}
4949
}
5050

51-
impl Trigger for ZooProcessor {
51+
impl Trigger for ZooProcessorRs {
5252
fn trigger<Context, Session, Lggr>(
5353
&self,
5454
context: &mut Context,
@@ -80,8 +80,8 @@ impl Trigger for ZooProcessor {
8080
}
8181
}
8282

83-
impl ProcessorDefinition for ZooProcessor {
84-
const DESCRIPTION: &'static str = "Test ZooProcessor";
83+
impl ProcessorDefinition for ZooProcessorRs {
84+
const DESCRIPTION: &'static str = "Test ZooProcessorRs";
8585
const INPUT_REQUIREMENT: ProcessorInputRequirement = ProcessorInputRequirement::Forbidden;
8686
const SUPPORTS_DYNAMIC_PROPERTIES: bool = false;
8787
const SUPPORTS_DYNAMIC_RELATIONSHIPS: bool = false;

0 commit comments

Comments
 (0)