Skip to content

Commit

Permalink
feat: check topic name in nats steps
Browse files Browse the repository at this point in the history
  • Loading branch information
metacoma committed Oct 2, 2024
1 parent debf962 commit d5de70d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
9 changes: 5 additions & 4 deletions tests/mindwm_bdd/features/3_mindwm_ping_pong.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@ping_pong
@mindwm_ping_pong
@mindwm_test
Feature: MindWM Ping-pong EDA test
Background:
Given A MindWM environment
Expand All @@ -18,7 +19,7 @@ Feature: MindWM Ping-pong EDA test
Then the host resource should be ready and operable
And NatsJetStreamChannel "<host>-host-broker-kne-trigger" is ready in "user-<username>" namespace

When God starts reading message from NATS topic "user-<username>.<host>-host-broker-kne-trigger._knative"
When God starts reading message from NATS topic ">"

Examples:
| context | username | host |
Expand Down Expand Up @@ -74,7 +75,7 @@ Feature: MindWM Ping-pong EDA test
| broker-ingress.knative-eventing |
| unknown_service |
| jetstream-ch-dispatcher |
And a cloudevent with type == "org.mindwm.v1.pong" should have been received from the NATS topic
And a cloudevent with type == "org.mindwm.v1.pong" should have been received from the NATS topic "user-<username>.<host>-host-broker-kne-trigger._knative"

Examples:
| context | username | host | endpoint | traceparent |
Expand All @@ -101,7 +102,7 @@ Feature: MindWM Ping-pong EDA test
| Deployment name |
| pong-00001-deployment |

And a cloudevent with type == "org.mindwm.v1.pong" should have been received from the NATS topic
And a cloudevent with type == "org.mindwm.v1.pong" should have been received from the NATS topic "user-<username>.<host>-host-broker-kne-trigger._knative"


Examples:
Expand Down
7 changes: 4 additions & 3 deletions tests/mindwm_bdd/features/5_mindwm_kafka_cdc.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@kafka_cdc
@mindwm_kafka_cdc
@mindwm_test
Feature: MindWM kafka_cdc function test
Background:
Given A MindWM environment
Expand All @@ -24,7 +25,7 @@ Feature: MindWM kafka_cdc function test
# MATCH (N) DETACH DELETE N;
# """

When God starts reading message from NATS topic "user-<username>.<host>-host-broker-kne-trigger._knative"
When God starts reading message from NATS topic ">"
And God makes graph query in context "<context>"
"""
CREATE (n:User {
Expand All @@ -39,7 +40,7 @@ Feature: MindWM kafka_cdc function test
Then following knative service is in ready state in "context-<context>" namespace
| Knative service name |
| kafka-cdc |
And a cloudevent with type == "org.mindwm.v1.graph.created" should have been received from the NATS topic
And a cloudevent with type == "org.mindwm.v1.graph.created" should have been received from the NATS topic "user-<username>.<host>-host-broker-kne-trigger._knative"

When God makes graph query in context "<context>"
"""
Expand Down
14 changes: 7 additions & 7 deletions tests/mindwm_bdd/features/6_mindwm_two_hosts_one_user.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@two_hosts_one_user
@mindwm_two_hosts_one_user
@mindwm_test
Feature: MindWM kafka_cdc function test
Background:
Given A MindWM environment
Expand Down Expand Up @@ -35,11 +36,11 @@ Feature: MindWM kafka_cdc function test

Scenario: Send ping via nats host: <host>, user: <username>
When God creates a new cloudevent
When God starts reading message from NATS topic "user-<username>.<host>-host-broker-kne-trigger._knative"
And God starts reading message from NATS topic ">"
And sets cloudevent header "ce-subject" to "#ping"
And sets cloudevent header "ce-type" to "org.mindwm.v1.iodocument"
And sets cloudevent header "ce-source" to "org.mindwm.<username>.<host>.<tmux_socket>.<uuid>.<tmux_window>.<tmux_pane>.iodocument"
And sends cloudevent to nats topic "org.mindwm.<username>.<host>.<tmux_socket>.<uuid>.<tmux_window><tmux_pane>.iodocument"
And sends cloudevent to nats topic "org.mindwm.<username>.<host>.<tmux_socket>.<uuid>.<tmux_window>.<tmux_pane>.iodocument"
"""
{
"input": "#ping",
Expand All @@ -53,7 +54,7 @@ Feature: MindWM kafka_cdc function test
| Deployment name |
| pong-00001-deployment |

And a cloudevent with type == "org.mindwm.v1.pong" should have been received from the NATS topic
And a cloudevent with type == "org.mindwm.v1.pong" should have been received from the NATS topic "user-<username>.<host>-host-broker-kne-trigger._knative"

Examples:
| context | username | host | tmux_pane | tmux_window | uuid | tmux_socket |
Expand All @@ -62,7 +63,6 @@ Feature: MindWM kafka_cdc function test

Scenario: Send iodocument via nats host: <host>, user: <username> and check that second host received graph the update
When God creates a new cloudevent
When God starts reading message from NATS topic "user-<username>.travellapop-host-broker-kne-trigger._knative"
And sets cloudevent header "ce-subject" to "id"
And sets cloudevent header "ce-type" to "org.mindwm.v1.iodocument"
And sets cloudevent header "ce-source" to "org.mindwm.<username>.<host>.<tmux_socket>.<uuid>.<tmux_window>.<tmux_pane>.iodocument"
Expand All @@ -81,12 +81,12 @@ Feature: MindWM kafka_cdc function test
| iocontext-00001-deployment |
| kafka-cdc-00001-deployment |

And a cloudevent with type == "org.mindwm.v1.graph.created" should have been received from the NATS topic
And a cloudevent with type == "org.mindwm.v1.graph.created" should have been received from the NATS topic "user-<username>.<host>-host-broker-kne-trigger._knative"

Examples:
| context | username | host | tmux_pane | tmux_window | uuid | tmux_socket |
| varanasi | shesha | workstation01 | 23 | 36 | 8d839f82-79da-11ef-bc9f-f74fac7543ac |L3RtcC90bXV4LTEwMDAvZGVmYXVsdA== |
# | varanasi | shesha | travellaptop | 23 | 36 | 8d839f82-79da-11ef-bc9f-f74fac7543ac |L3RtcC90bXV4LTEwMDAvZGVmYXVsdA== |
| varanasi | shesha | travellaptop | 23 | 36 | 8d839f82-79da-11ef-bc9f-f74fac7543ac |L3RtcC90bXV4LTEwMDAvZGVmYXVsdA== |


Scenario: Cleanup hosts <host> in user <username>
Expand Down

0 comments on commit d5de70d

Please sign in to comment.