-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.create
123 lines (94 loc) · 3.68 KB
/
Makefile.create
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# This Makefile regenerates session template files and test plan files.
# The generated files are also checked-in, so new users can get started quickly.
#
# This attempt to run executable `feditest` in your $PATH. If you'd like
# to run a different executable, such as one in a virtual environment,
# invoke this Makefile with extra parameter FEDITEST=path/to/my/feditest
#
FEDITEST?=feditest
Q?=
# Could set from the command-line to something like: 'Q=.$(shell git branch --show-current)'
EX?=examples$(Q)
default : all
all : $(EX)
$(EX) : \
$(EX)-session-templates \
$(EX)-constellations \
$(EX)-testplans
########## Example session templates ##########
$(EX)-session-templates : \
$(EX)/session-templates/sandbox-all.json
$(EX)/session-templates/sandbox-all.json : \
dirs \
tests/sandbox/*.py
$(FEDITEST) create-session-template \
--name 'All sandbox tests' \
--filter 'sandbox' \
--out $@
##### Example constellations ##########
$(EX)-constellations : \
$(EX)/constellations/clientA-vs-server1.json \
$(EX)/constellations/clientA-vs-server2faulty.json
$(EX)/constellations/clientA-vs-server1.json : \
dirs \
examples/nodes/clientA.json \
examples/nodes/server1.json
$(FEDITEST) create-constellation \
--name 'clientA vs server1' \
--node client=examples/nodes/clientA.json \
--node server=examples/nodes/server1.json \
--out $@
$(EX)/constellations/clientA-vs-server2faulty.json : \
dirs \
examples/nodes/clientA.json \
examples/nodes/server2faulty.json
$(FEDITEST) create-constellation \
--name 'clientA vs server2faulty' \
--node client=examples/nodes/clientA.json \
--node server=examples/nodes/server2faulty.json \
--out $@
#### Example test plans ##########
$(EX)-testplans : \
$(EX)/testplans/sandbox-all-clientA-vs-server1.json \
$(EX)/testplans/sandbox-all-clientA-vs-server2faulty.json \
$(EX)/testplans/sandbox-all-clientA-vs-both-server1-server2faulty.json
$(EX)/testplans/sandbox-all-clientA-vs-server1.json : \
dirs \
$(EX)/session-templates/sandbox-all.json \
$(EX)/constellations/clientA-vs-server1.json
$(FEDITEST) create-testplan \
--name 'All sandbox tests running clientA against server1' \
--session-template $(EX)/session-templates/sandbox-all.json \
--constellation $(EX)/constellations/clientA-vs-server1.json \
--out $@
$(EX)/testplans/sandbox-all-clientA-vs-server2faulty.json : \
dirs \
$(EX)/session-templates/sandbox-all.json \
$(EX)/constellations/clientA-vs-server2faulty.json
$(FEDITEST) create-testplan \
--name 'All sandbox tests running clientA against faulty server2' \
--session-template $(EX)/session-templates/sandbox-all.json \
--constellation $(EX)/constellations/clientA-vs-server2faulty.json \
--out $@
$(EX)/testplans/sandbox-all-clientA-vs-both-server1-server2faulty.json : \
dirs \
$(EX)/session-templates/sandbox-all.json \
$(EX)/constellations/clientA-vs-server1.json \
$(EX)/constellations/clientA-vs-server2faulty.json
$(FEDITEST) create-testplan \
--name 'All sandbox tests running clientA against both server1 and then faulty server2' \
--session-template $(EX)/session-templates/sandbox-all.json \
--constellation $(EX)/constellations/clientA-vs-server1.json \
--constellation $(EX)/constellations/clientA-vs-server2faulty.json \
--out $@
########## and the rest ##########
dirs:
[[ -d $(EX)/session-templates ]] || mkdir -p $(EX)/session-templates
[[ -d $(EX)/constellations ]] || mkdir -p $(EX)/constellations
[[ -d $(EX)/testplans ]] || mkdir -p $(EX)/testplans
clean :
rm $(EX)/{session-templates,constellations,testplans}/*.json >/dev/null 2>&1 || true
.PHONY : \
default all dirs clean \
$(EX) $(EX)-session-templates $(EX)-constellations $(EX)-testplans