-
Notifications
You must be signed in to change notification settings - Fork 1
/
Justfile
126 lines (92 loc) · 2.42 KB
/
Justfile
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
123
124
125
126
elixir_dir := justfile_directory() / "elixir"
ruby_dir := justfile_directory() / "ruby"
ts_dir := justfile_directory() / "ts"
suite_dir := justfile_directory() / "suite"
tapview := justfile_directory() / "integration" / "tapview"
[private]
default:
just --list
# Generate and run the integration suite. type=[all, elixir, ruby, typescript]
execute-suite type="all": (generate-suite type) (run-suite type)
# Generates the integration test suite. type=[all, elixir, ruby, typescript]
generate-suite type="all":
#!/usr/bin/env bash
set -euo pipefail
case "{{ type }}" in
all | elixir | ruby | ts | typescript) : ;;
*)
echo >&2 Unknown type {{ type }}.
exit 1
;;
esac
mkdir -p "{{ suite_dir }}"
rm -f "{{ suite_dir }}"/*.json
case "{{ type }}" in
all | elixir) just generate-elixir ;;
esac
case "{{ type }}" in
all | ruby) just generate-ruby ;;
esac
case "{{ type }}" in
all | ts | typescript) just generate-ts ;;
esac
[private]
generate-elixir:
#!/usr/bin/env bash
set -euo pipefail
cd "{{ elixir_dir }}"
mix app_identity generate "{{ suite_dir }}"
[private]
generate-ruby:
#!/usr/bin/env bash
set -euo pipefail
cd "{{ ruby_dir }}"
bundle exec ruby -S bin/app-identity-suite-ruby generate "{{ suite_dir }}"
[private]
generate-ts:
#!/usr/bin/env bash
set -euo pipefail
cd "{{ ts_dir }}"
pnpm --silent cli:generate "{{ suite_dir }}"
# Runs the integration test suite. type=[all, elixir, ruby, typescript]
run-suite type="all":
#!/usr/bin/env bash
set -euo pipefail
case "{{ type }}" in
all | elixir | ruby | ts | typescript) : ;;
*)
echo >&2 Unknown type {{ type }}.
exit 1
;;
esac
if ! [[ -d "{{ suite_dir }}" ]]; then
echo >&2 Suite {{ suite_dir }} does not exist.
fi
case "{{ type }}" in
all | elixir) just run-elixir ;;
esac
case "{{ type }}" in
all | ruby) just run-ruby ;;
esac
case "{{ type }}" in
all | ts | typescript) just run-ts ;;
esac
[private]
run-elixir:
#!/usr/bin/env bash
set -euo pipefail
cd "{{ elixir_dir }}"
mix app_identity run "{{ suite_dir }}" | "{{ tapview }}"
[private]
run-ruby:
#!/usr/bin/env bash
set -euo pipefail
cd "{{ ruby_dir }}"
bundle exec ruby -S bin/app-identity-suite-ruby run "{{ suite_dir }}" |
"{{ tapview }}"
[private]
run-ts:
#!/usr/bin/env bash
set -euo pipefail
cd "{{ ts_dir }}"
pnpm --silent cli:run "{{ suite_dir }}" | "{{ tapview }}"