Skip to content

Commit 9ac8c53

Browse files
committed
Backport dapr#814
Fix validations using the latest CLI Signed-off-by: joshvanl <me@joshvanl.dev>
1 parent b8faa0c commit 9ac8c53

File tree

31 files changed

+411
-321
lines changed

31 files changed

+411
-321
lines changed

examples/actor/README.md

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
name: Run Actor server
1313
output_match_mode: substring
1414
expected_stdout_lines:
15-
- '== APP == call get user req = &{abc 123}'
16-
- '== APP == get req = laurence'
17-
- '== APP == get post request = laurence'
18-
- '== APP == get req = hello'
19-
- '== APP == get req = hello'
20-
- '== APP == receive reminder = testReminderName state = "hello"'
21-
- '== APP == receive reminder = testReminderName state = "hello"'
15+
- 'call get user req = &{abc 123}'
16+
- 'get req = laurence'
17+
- 'get post request = laurence'
18+
- 'get req = hello'
19+
- 'get req = hello'
20+
- 'receive reminder = testReminderName state = "hello"'
21+
- 'receive reminder = testReminderName state = "hello"'
2222
background: true
23-
sleep: 30
2423
timeout_seconds: 60
2524
-->
2625

@@ -42,19 +41,17 @@ dapr run --app-id actor-serving \
4241
name: Run Actor Client
4342
output_match_mode: substring
4443
expected_stdout_lines:
45-
- '== APP == get user result = &{abc 123}'
46-
- '== APP == get invoke result = laurence'
47-
- '== APP == get post result = laurence'
48-
- '== APP == get result = get result'
49-
- '== APP == start timer'
50-
- '== APP == stop timer'
51-
- '== APP == start reminder'
52-
- '== APP == stop reminder'
53-
- '== APP == get user = {Name: Age:1}'
54-
- '== APP == get user = {Name: Age:2}'
44+
- 'get user result = &{abc 123}'
45+
- 'get invoke result = laurence'
46+
- 'get post result = laurence'
47+
- 'get result = get result'
48+
- 'start timer'
49+
- 'stop timer'
50+
- 'start reminder'
51+
- 'stop reminder'
52+
- 'get user = {Name: Age:1}'
53+
- 'get user = {Name: Age:2}'
5554
56-
background: true
57-
sleep: 40
5855
timeout_seconds: 60
5956
-->
6057

@@ -69,36 +66,43 @@ dapr run --app-id actor-client \
6966

7067
### Cleanup
7168

69+
<!-- STEP
70+
name: Cleanup actor server
71+
expected_return_code:
72+
-->
73+
7274
```bash
7375
dapr stop --app-id actor-serving
7476
(lsof -i:8080 | grep main) | awk '{print $2}' | xargs kill
7577
```
7678

79+
<!-- END_STEP -->
80+
7781
## Result
7882
- client side
7983
```
80-
== APP == dapr client initializing for: 127.0.0.1:55776
81-
== APP == get user result = &{abc 123}
82-
== APP == get invoke result = laurence
83-
== APP == get post result = laurence
84-
== APP == get result = get result
85-
== APP == start timer
86-
== APP == stop timer
87-
== APP == start reminder
88-
== APP == stop reminder
89-
== APP == get user = {Name: Age:1}
90-
== APP == get user = {Name: Age:2}
84+
dapr client initializing for: 127.0.0.1:55776
85+
get user result = &{abc 123}
86+
get invoke result = laurence
87+
get post result = laurence
88+
get result = get result
89+
start timer
90+
stop timer
91+
start reminder
92+
stop reminder
93+
get user = {Name: Age:1}
94+
get user = {Name: Age:2}
9195
✅ Exited App successfully
9296
```
9397

9498
- server side
9599

96100
```
97-
== APP == call get user req = &{abc 123}
98-
== APP == get req = laurence
99-
== APP == get post request = laurence
100-
== APP == get req = hello
101-
== APP == get req = hello
102-
== APP == receive reminder = testReminderName state = "hello"
103-
== APP == receive reminder = testReminderName state = "hello"
101+
call get user req = &{abc 123}
102+
get req = laurence
103+
get post request = laurence
104+
get req = hello
105+
get req = hello
106+
receive reminder = testReminderName state = "hello"
107+
receive reminder = testReminderName state = "hello"
104108
```

examples/actor/serving/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"fmt"
1919
"log"
2020
"net/http"
21+
"os"
2122
"time"
2223

2324
"github.com/dapr/go-sdk/actor"
@@ -28,6 +29,8 @@ import (
2829
daprd "github.com/dapr/go-sdk/service/http"
2930
)
3031

32+
var logger = log.New(os.Stdout, "", log.LstdFlags)
33+
3134
func testActorFactory() actor.ServerContext {
3235
client, err := dapr.NewClient()
3336
if err != nil {
@@ -137,6 +140,6 @@ func main() {
137140
s := daprd.NewService(":8080")
138141
s.RegisterActorImplFactoryContext(testActorFactory)
139142
if err := s.Start(); err != nil && err != http.ErrServerClosed {
140-
log.Fatalf("error listenning: %v", err)
143+
logger.Fatalf("error listening: %v", err)
141144
}
142145
}

examples/configuration/README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ name: Run Configuration Client
1313
output_match_mode: substring
1414
match_order: none
1515
expected_stdout_lines:
16-
- '== APP == got config key = mykey, value = myConfigValue'
17-
- '== APP == got config key = mySubscribeKey1, value = mySubscribeValue1'
18-
- '== APP == got config key = mySubscribeKey2, value = mySubscribeValue1'
19-
- '== APP == got config key = mySubscribeKey3, value = mySubscribeValue1'
20-
- '== APP == got config key = mySubscribeKey1, value = mySubscribeValue2'
21-
- '== APP == got config key = mySubscribeKey2, value = mySubscribeValue2'
22-
- '== APP == got config key = mySubscribeKey3, value = mySubscribeValue2'
23-
- '== APP == got config key = mySubscribeKey1, value = mySubscribeValue3'
24-
- '== APP == got config key = mySubscribeKey2, value = mySubscribeValue3'
25-
- '== APP == got config key = mySubscribeKey3, value = mySubscribeValue3'
26-
- '== APP == dapr configuration subscribe finished.'
16+
- 'got config key = mykey, value = myConfigValue'
17+
- 'got config key = mySubscribeKey1, value = mySubscribeValue1'
18+
- 'got config key = mySubscribeKey2, value = mySubscribeValue1'
19+
- 'got config key = mySubscribeKey3, value = mySubscribeValue1'
20+
- 'got config key = mySubscribeKey1, value = mySubscribeValue2'
21+
- 'got config key = mySubscribeKey2, value = mySubscribeValue2'
22+
- 'got config key = mySubscribeKey3, value = mySubscribeValue2'
23+
- 'got config key = mySubscribeKey1, value = mySubscribeValue3'
24+
- 'got config key = mySubscribeKey2, value = mySubscribeValue3'
25+
- 'got config key = mySubscribeKey3, value = mySubscribeValue3'
26+
- 'dapr configuration subscribe finished.'
2727
background: false
2828
sleep: 40
2929
timeout_seconds: 60
@@ -50,21 +50,21 @@ The subscription event order may out of order.
5050
```
5151
got config key = mykey, value = myConfigValue
5252
53-
got config key = mySubscribeKey1, value = mySubscribeValue1
54-
got config key = mySubscribeKey2, value = mySubscribeValue1
55-
got config key = mySubscribeKey3, value = mySubscribeValue1
56-
got config key = mySubscribeKey1, value = mySubscribeValue2
57-
got config key = mySubscribeKey2, value = mySubscribeValue2
58-
got config key = mySubscribeKey3, value = mySubscribeValue2
59-
got config key = mySubscribeKey1, value = mySubscribeValue3
60-
got config key = mySubscribeKey2, value = mySubscribeValue3
61-
got config key = mySubscribeKey3, value = mySubscribeValue3
62-
got config key = mySubscribeKey1, value = mySubscribeValue4
63-
got config key = mySubscribeKey2, value = mySubscribeValue4
64-
got config key = mySubscribeKey3, value = mySubscribeValue4
65-
got config key = mySubscribeKey1, value = mySubscribeValue5
66-
got config key = mySubscribeKey2, value = mySubscribeValue5
67-
got config key = mySubscribeKey3, value = mySubscribeValue5
53+
got config key = mySubscribeKey1, value = mySubscribeValue1
54+
got config key = mySubscribeKey2, value = mySubscribeValue1
55+
got config key = mySubscribeKey3, value = mySubscribeValue1
56+
got config key = mySubscribeKey1, value = mySubscribeValue2
57+
got config key = mySubscribeKey2, value = mySubscribeValue2
58+
got config key = mySubscribeKey3, value = mySubscribeValue2
59+
got config key = mySubscribeKey1, value = mySubscribeValue3
60+
got config key = mySubscribeKey2, value = mySubscribeValue3
61+
got config key = mySubscribeKey3, value = mySubscribeValue3
62+
got config key = mySubscribeKey1, value = mySubscribeValue4
63+
got config key = mySubscribeKey2, value = mySubscribeValue4
64+
got config key = mySubscribeKey3, value = mySubscribeValue4
65+
got config key = mySubscribeKey1, value = mySubscribeValue5
66+
got config key = mySubscribeKey2, value = mySubscribeValue5
67+
got config key = mySubscribeKey3, value = mySubscribeValue5
6868
dapr configuration subscribe finished.
6969
dapr configuration unsubscribed
7070
✅ Exited App successfully

examples/conversation-alpha1/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
name: Run Conversation
1313
output_match_mode: substring
1414
expected_stdout_lines:
15-
- '== APP == conversation output: hello world'
15+
- 'conversation output: hello world'
1616
1717
background: true
1818
sleep: 60
@@ -32,5 +32,5 @@ dapr run --app-id conversation \
3232
## Result
3333

3434
```
35-
- '== APP == conversation output: hello world'
35+
- 'conversation output: hello world'
3636
```

examples/conversation-alpha1/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ import (
1818
"context"
1919
"fmt"
2020
"log"
21+
"os"
2122

2223
dapr "github.com/dapr/go-sdk/client"
2324
)
2425

26+
var logger = log.New(os.Stdout, "", log.LstdFlags)
27+
2528
func main() {
2629
client, err := dapr.NewClient()
2730
if err != nil {
@@ -42,7 +45,7 @@ func main() {
4245

4346
resp, err := client.ConverseAlpha1(context.Background(), request)
4447
if err != nil {
45-
log.Fatalf("err: %v", err)
48+
logger.Fatalf("err: %v", err)
4649
}
4750

4851
fmt.Printf("conversation output: %s\n", resp.Outputs[0].Result)

examples/conversation-alpha2/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
name: Run Conversation
1313
output_match_mode: substring
1414
expected_stdout_lines:
15-
- '== APP == conversation input: hello world'
16-
- '== APP == conversation output: hello world'
15+
- 'conversation input: hello world'
16+
- 'conversation output: hello world'
1717
1818
background: true
1919
sleep: 60
@@ -33,5 +33,5 @@ dapr run --app-id conversation \
3333
## Result
3434

3535
```
36-
- '== APP == conversation output: hello world'
36+
- 'conversation output: hello world'
3737
```

examples/conversation-alpha2/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ import (
1818
"context"
1919
"fmt"
2020
"log"
21+
"os"
2122

2223
dapr "github.com/dapr/go-sdk/client"
2324
)
2425

26+
var logger = log.New(os.Stdout, "", log.LstdFlags)
27+
2528
func main() {
2629
client, err := dapr.NewClient()
2730
if err != nil {
@@ -68,7 +71,7 @@ func main() {
6871

6972
resp, err := client.ConverseAlpha2(context.Background(), request)
7073
if err != nil {
71-
log.Fatalf("err: %v", err)
74+
logger.Fatalf("err: %v", err)
7275
}
7376

7477
fmt.Printf("conversation output: %s\n", resp.Outputs[0].Choices[0].Message.Content)

examples/crypto/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ openssl rand -out keys/symmetric-key-256 32
3636
<!-- STEP
3737
name: Run crypto example
3838
expected_stdout_lines:
39-
- '== APP == Encrypted the message, got 856 bytes'
40-
- '== APP == Decrypted the message, got 24 bytes'
41-
- '== APP == The secret is "passw0rd"'
42-
- '== APP == Wrote encrypted data to encrypted.out'
43-
- '== APP == Wrote decrypted data to decrypted.out.jpg'
39+
- 'Encrypted the message, got 856 bytes'
40+
- 'Decrypted the message, got 24 bytes'
41+
- 'The secret is "passw0rd"'
42+
- 'Wrote encrypted data to encrypted.out'
43+
- 'Wrote decrypted data to decrypted.out.jpg'
4444
- "Exited App successfully"
4545
expected_stderr_lines:
4646
output_match_mode: substring
@@ -66,9 +66,9 @@ dapr stop --app-id crypto
6666
## Result
6767

6868
```shell
69-
== APP == Encrypted the message, got 856 bytes
70-
== APP == Decrypted the message, got 24 bytes
71-
== APP == The secret is "passw0rd"
72-
== APP == Wrote encrypted data to encrypted.out
73-
== APP == Wrote decrypted data to decrypted.out.jpg
69+
Encrypted the message, got 856 bytes
70+
Decrypted the message, got 24 bytes
71+
The secret is "passw0rd"
72+
Wrote encrypted data to encrypted.out
73+
Wrote decrypted data to decrypted.out.jpg
7474
```

0 commit comments

Comments
 (0)