-
Notifications
You must be signed in to change notification settings - Fork 14
/
basic.yaml
54 lines (48 loc) · 1.67 KB
/
basic.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: basic
doc: |
Just a very pub/recv simple test.
We ask the mother channel to make a "mock" channel, which just emits
what it receives. Then we test that mock channel.
labels:
- selftest
- basic
- donotskip
spec:
phases:
phase1:
steps:
- pub:
doc: |
Ask Mother to make a mock channel.
The only channel that exists is the Mother channel, so
we don't have to specify 'chan: mother'.
payload:
make:
name: mock
type: mock
- recv:
doc: |
Check that our request succeeded.
We now (hopefully) have two channels, and the default
channel is that one non-mother channel. We want to
example the output of the mother channel, so we have to
specify that.
chan: mother
pattern:
success: true
- pub:
doc: |
Default channel is (now) the only non-mother channel, so
we don't have to specific 'chan: mock' here.
Let's send our new channel a message. In the next step,
we'll check what the channel emits.
payload: '{"want":"queso"}'
- recv:
doc: |
Check that we hear a message that has a reasonable
structure.
The pattern matching will binding the variable '?x', but
this test won't do anything with that binding. Note
that we could receive a message that's not what we sent,
so this test isn't very precise.
pattern: '{"want":"?x"}'