-
-
Notifications
You must be signed in to change notification settings - Fork 152
/
main.go
661 lines (566 loc) · 18.3 KB
/
main.go
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path"
"path/filepath"
"sort"
"strings"
"github.com/urfave/cli"
)
var ciPlatforms = []string{"ubuntu2204", "windows", "macos"}
var ciPlatformsMap = map[string][]string{
"linux": []string{"ubuntu2204"},
"windows": []string{"windows"},
"macos": []string{"macos"},
}
var extraPlatformFlags = map[string][]string{
"ubuntu2204": []string{},
"windows": []string{},
"macos": []string{
// Fix clash between OpenSSL and BoringSSL on recent MacOS versions, by marking
// /usr/local/include as a system include search dir. This prevents redefinition errors when
// BoringSSL files end up including OpenSSL headers due to matching include prefix. This arg
// moves the OpenSSL headers (and anything in that search dir) lower in priority vs local
// files comong from -iquote etc. This only appears to be a problem on the Bazel MacOS CI
// machines on BuildKite, as a local MacOS build does not require this workaround. Perhaps
// the CI machines have Homebrew installed etc.
"--copt=-isystem/usr/local/include",
},
}
func main() {
app := cli.NewApp()
app.Name = "rulegen"
app.Flags = []cli.Flag{
&cli.StringFlag{
Name: "dir",
Usage: "Directory to scan",
Value: ".",
},
&cli.StringFlag{
Name: "module_template",
Usage: "Template for the main MODULE.bazel",
Value: "tools/rulegen/MODULE.bazel.template",
},
&cli.StringFlag{
Name: "readme_header_template",
Usage: "Template for the main readme header",
Value: "tools/rulegen/README.header.md",
},
&cli.StringFlag{
Name: "readme_footer_template",
Usage: "Template for the main readme footer",
Value: "tools/rulegen/README.footer.md",
},
&cli.StringFlag{
Name: "available_tests",
Usage: "File containing the list of available routeguide tests",
Value: "available_tests.txt",
},
}
app.Action = func(c *cli.Context) error {
err := action(c)
if err != nil {
return cli.NewExitError("%v", 1)
}
return nil
}
app.Run(os.Args)
}
func action(c *cli.Context) error {
dir := c.String("dir")
if dir == "" {
return fmt.Errorf("--dir required")
}
languages := []*Language{
makeBuf(),
makeC(),
makeCpp(),
makeDoc(),
makeGo(),
makeGrpcGateway(),
makeObjc(),
makePython(),
}
for _, lang := range languages {
mustWriteLanguageReadme(dir, lang)
mustWriteLanguageDefs(dir, lang)
mustWriteLanguageRules(dir, lang)
mustWriteLanguageExamples(dir, lang)
}
mustWriteModuleBazel(dir, c.String("module_template"), languages)
mustWriteBazelignore(dir, languages)
mustWriteReadme(dir, c.String("readme_header_template"), c.String("readme_footer_template"), languages)
mustWriteBazelCIPresubmitYml(dir, languages, c.String("available_tests"))
mustWriteExamplesMakefile(dir, languages)
mustWriteTestWorkspacesMakefile(dir)
return nil
}
func mustWriteLanguageRules(dir string, lang *Language) {
for _, rule := range lang.Rules {
mustWriteLanguageRule(dir, lang, rule)
}
}
func mustWriteLanguageRule(dir string, lang *Language, rule *Rule) {
out := &LineWriter{}
out.t(mustTemplate(`"""Generated definition of {{ .Rule.Name }}."""`), &RuleTemplatingData{lang, rule, commonTemplatingFields}, "")
out.ln()
out.t(rule.Implementation, &RuleTemplatingData{lang, rule, commonTemplatingFields}, "")
out.ln()
out.MustWrite(filepath.Join(dir, "modules", lang.Name, rule.Name + ".bzl"))
}
func mustWriteLanguageExamples(dir string, lang *Language) {
for _, rule := range lang.Rules {
exampleDir := filepath.Join(dir, "examples", lang.Name, rule.Name)
err := os.MkdirAll(exampleDir, os.ModePerm)
if err != nil {
log.Fatalf("FAILED to create %s: %v", exampleDir, err)
}
mustWriteLanguageExampleStaticFiles(exampleDir, lang, rule)
mustWriteLanguageExampleModuleBazelFile(exampleDir, lang, rule)
mustWriteLanguageExampleBuildFile(exampleDir, lang, rule)
}
}
func mustWriteLanguageExampleStaticFiles(dir string, lang *Language, rule *Rule) {
// Write empty WORKSPACE file to indicate Bazel workspace root
out := &LineWriter{}
out.MustWrite(filepath.Join(dir, "WORKSPACE"))
}
func mustWriteLanguageExampleModuleBazelFile(dir string, lang *Language, rule *Rule) {
out := &LineWriter{}
depth := strings.Split(lang.Name, "/")
// +2 as we are in the examples/{rule} subdirectory
rootPath := strings.Repeat("../", len(depth) + 2)
if (len(lang.ModulePrefixLines) > 0) {
out.ln()
out.w(lang.ModulePrefixLines)
}
extraDeps := ""
extraLocalOverrides := ""
for _, dep := range lang.DependsOn {
extraDeps += fmt.Sprintf("\nbazel_dep(name = \"rules_proto_grpc_%s\", version = \"0.0.0.rpg.version.placeholder\")", dep)
extraLocalOverrides += fmt.Sprintf(`
local_path_override(
module_name = "rules_proto_grpc_%s",
path = "%smodules/%s",
)`, dep, rootPath, dep)
}
out.w(`bazel_dep(name = "rules_proto_grpc", version = "0.0.0.rpg.version.placeholder")
bazel_dep(name = "rules_proto_grpc_example_protos", version = "0.0.0.rpg.version.placeholder")
bazel_dep(name = "rules_proto_grpc_%s", version = "0.0.0.rpg.version.placeholder")%s
local_path_override(
module_name = "rules_proto_grpc",
path = "%smodules/core",
)
local_path_override(
module_name = "rules_proto_grpc_example_protos",
path = "%smodules/example_protos",
)
local_path_override(
module_name = "rules_proto_grpc_%s",
path = "%smodules/%s",
)%s`, lang.Name, extraDeps, rootPath, rootPath, lang.Name, rootPath, lang.Name, extraLocalOverrides)
if (len(lang.ModuleSuffixLines) > 0) {
out.ln()
out.w(lang.ModuleSuffixLines)
}
out.ln()
out.MustWrite(filepath.Join(dir, "MODULE.bazel"))
}
func mustWriteLanguageExampleBuildFile(dir string, lang *Language, rule *Rule) {
out := &LineWriter{}
out.t(rule.BuildExample, &RuleTemplatingData{lang, rule, commonTemplatingFields}, "")
out.ln()
out.MustWrite(filepath.Join(dir, "BUILD.bazel"))
}
func mustWriteLanguageDefs(dir string, lang *Language) {
out := &LineWriter{}
out.w("\"\"\"%s protobuf and grpc rules.\"\"\"", lang.Name)
out.ln()
extraDefs := make([]string, 0, len(lang.ExtraDefs))
for def := range lang.ExtraDefs {
extraDefs = append(extraDefs, def)
}
sort.Strings(extraDefs)
ruleNames := make([]string, 0, len(lang.Rules))
for _, rule := range lang.Rules {
ruleNames = append(ruleNames, rule.Name)
}
sort.Strings(ruleNames)
for _, ruleName := range ruleNames {
out.w(`load(":%s.bzl", _%s = "%s")`, ruleName, ruleName, ruleName)
}
for _, def := range extraDefs {
out.w(`load("%s", _%s = "%s") # buildifier: disable=same-origin-load # buildifier: disable=out-of-order-load`, lang.ExtraDefs[def], def, def)
}
out.ln()
out.w("# Export %s rules", lang.Name)
for _, rule := range lang.Rules {
out.w(`%s = _%s`, rule.Name, rule.Name)
}
out.ln()
if len(lang.Aliases) > 0 {
out.w(`# Aliases`)
aliases := make([]string, 0, len(lang.Aliases))
for alias := range lang.Aliases {
aliases = append(aliases, alias)
}
sort.Strings(aliases)
for _, alias := range aliases {
out.w(`%s = _%s`, alias, lang.Aliases[alias])
}
out.ln()
}
if len(lang.ExtraDefs) > 0 {
out.w(`# Extra defs`)
for _, def := range extraDefs {
out.w(`%s = _%s`, def, def)
}
out.ln()
}
out.MustWrite(filepath.Join(dir, "modules", lang.Name, "defs.bzl"))
}
func mustWriteLanguageReadme(dir string, lang *Language) {
out := &LineWriter{}
out.w(":author: rules_proto_grpc")
out.w(":description: rules_proto_grpc Bazel rules for %s", lang.DisplayName)
out.w(":keywords: Bazel, Protobuf, gRPC, Protocol Buffers, Rules, Build, Starlark, %s", lang.DisplayName)
out.ln()
out.ln()
out.w("%s", lang.DisplayName)
out.w("%s", strings.Repeat("=", len(lang.DisplayName)))
out.ln()
if lang.Notes != nil {
out.t(lang.Notes, lang, "")
out.ln()
}
out.w(".. list-table:: Rules")
out.w(" :widths: 1 2")
out.w(" :header-rows: 1")
out.ln()
out.w(" * - Rule")
out.w(" - Description")
for _, rule := range lang.Rules {
out.w(" * - `%s`_", rule.Name)
out.w(" - %s", rule.Doc)
}
out.ln()
for _, rule := range lang.Rules {
out.w(".. _%s:", rule.Name)
out.ln()
out.w("%s", rule.Name)
out.w("%s", strings.Repeat("-", len(rule.Name)))
out.ln()
if rule.Experimental {
out.w(".. warning:: This rule is experimental. It may not work correctly or may change in future releases!")
out.ln()
}
out.w(rule.Doc)
out.ln()
out.w("Example")
out.w("*******")
out.ln()
out.w("Full example project can be found `here <https://github.com/rules-proto-grpc/rules_proto_grpc/tree/master/examples/%s/%s>`__", lang.Name, rule.Name)
out.ln()
out.w("``BUILD.bazel``")
out.w("^^^^^^^^^^^^^^^")
out.ln()
out.w(".. code-block:: python")
out.ln()
out.t(rule.BuildExample, &RuleTemplatingData{lang, rule, commonTemplatingFields}, " ")
out.ln()
out.w("Attributes")
out.w("**********")
out.ln()
out.w(".. list-table:: Attributes for %s", rule.Name)
out.w(" :widths: 1 1 1 1 4")
out.w(" :header-rows: 1")
out.ln()
out.w(" * - Name")
out.w(" - Type")
out.w(" - Mandatory")
out.w(" - Default")
out.w(" - Description")
for _, attr := range rule.Attrs {
out.w(" * - ``%s``", attr.Name)
out.w(" - ``%s``", attr.Type)
out.w(" - %t", attr.Mandatory)
if len(attr.Default) > 0 {
out.w(" - ``%s``", attr.Default)
} else {
out.w(" - ")
}
out.w(" - %s", attr.Doc)
}
out.ln()
if len(rule.Plugins) > 0 {
out.w("Plugins")
out.w("*******")
out.ln()
for _, plugin := range rule.Plugins {
out.w("- `@rules_proto_grpc_%s%s <https://github.com/rules-proto-grpc/rules_proto_grpc/blob/master/%s/BUILD.bazel>`__", lang.Name, plugin, lang.Name)
}
out.ln()
}
}
out.MustWrite(filepath.Join(dir, "docs", "lang", lang.Name + ".rst"))
}
func mustWriteModuleBazel(dir, template string, languages []*Language) {
out := &LineWriter{}
out.tpl(template, struct{}{})
for _, lang := range languages {
out.w("# %s", lang.DisplayName)
if (len(lang.ModulePrefixLines) > 0) {
out.w(lang.ModulePrefixLines)
out.ln()
}
out.w(`bazel_dep(name = "rules_proto_grpc_%s", version = "0.0.0.rpg.version.placeholder")
local_path_override(
module_name = "rules_proto_grpc_%s",
path = "modules/%s",
)`, lang.Name, lang.Name, lang.Name)
out.ln()
if (len(lang.ModuleSuffixLines) > 0) {
out.w(lang.ModuleSuffixLines)
out.ln()
}
}
out.MustWrite(filepath.Join(dir, "MODULE.bazel"))
}
func mustWriteBazelignore(dir string, languages []*Language) {
// Write constant header
out := &LineWriter{}
out.w("modules")
out.w("test_workspaces")
out.ln()
//
// Write example ignores
//
for _, lang := range languages {
for _, rule := range lang.Rules {
out.w("examples/%s/%s", lang.Name, rule.Name)
}
out.ln()
}
out.MustWrite(filepath.Join(dir, ".bazelignore"))
}
func mustWriteReadme(dir, header, footer string, languages []*Language) {
out := &LineWriter{}
out.tpl(header, struct{}{})
out.ln()
out.w("## Rules")
out.ln()
out.w("| Language | Rule | Description")
out.w("| ---: | :--- | :--- |")
for _, lang := range languages {
for _, rule := range lang.Rules {
dirLink := fmt.Sprintf("[%s](https://rules-proto-grpc.com/en/latest/lang/%s.html)", lang.DisplayName, lang.Name)
ruleLink := fmt.Sprintf("[%s](https://rules-proto-grpc.com/en/latest/lang/%s.html#%s)", rule.Name, lang.Name, strings.ReplaceAll(rule.Name, "_", "-"))
exampleLink := fmt.Sprintf("[example](/examples/%s/%s)", lang.Name, rule.Name)
out.w("| %s | %s | %s (%s) |", dirLink, ruleLink, rule.Doc, exampleLink)
}
}
out.ln()
out.tpl(footer, struct{}{})
out.MustWrite(filepath.Join(dir, "README.md"))
}
func mustWriteBazelCIPresubmitYml(dir string, languages []*Language, availableTestsPath string) {
// Read available tests
content, err := ioutil.ReadFile(availableTestsPath)
if err != nil {
log.Fatal(err)
}
availableTestLabels := strings.Split(string(content), "\n")
// Write header
out := &LineWriter{}
out.w("---")
out.w("tasks:")
//
// Write tasks for main code
//
for _, ciPlatform := range ciPlatforms {
out.w(" main_%s:", ciPlatform)
out.w(" name: Build & Test All")
out.w(" platform: %s", ciPlatform)
// out.w(" environment:")
// out.w(` CC: clang`)
out.w(" test_flags:")
out.w(` - "--test_output=errors"`)
if ciPlatform == "windows" {
out.w(` - "--enable_runfiles"`) // Needed for sh_test to work correctly
out.w(` - "--cxxopt=/std:c++17"`)
out.w(` - "--host_cxxopt=/std:c++17"`)
} else {
out.w(` - "--cxxopt=-std=c++17"`)
out.w(` - "--host_cxxopt=-std=c++17"`)
}
for _, flag := range extraPlatformFlags[ciPlatform] {
out.w(` - "%s"`, flag)
}
out.w(" test_targets:")
for _, clientLang := range languages {
for _, serverLang := range languages {
if doTestOnPlatform(clientLang, nil, ciPlatform) && doTestOnPlatform(serverLang, nil, ciPlatform) && stringInSlice(fmt.Sprintf("//examples/routeguide:%s_%s", clientLang.Name, serverLang.Name), availableTestLabels) {
out.w(` - "//examples/routeguide:%s_%s"`, clientLang.Name, serverLang.Name)
}
}
}
out.ln()
}
//
// Write tasks for examples
//
for _, lang := range languages {
for _, ciPlatform := range ciPlatforms {
// Check platform has at least one example to run
platformHasCommand := false
for _, rule := range lang.Rules {
if doTestOnPlatform(lang, rule, ciPlatform) {
platformHasCommand = true
break
}
}
if !platformHasCommand {
continue
}
// Write task
out.w(" %s_%s_examples:", lang.Name, ciPlatform)
out.w(" name: %s", lang.DisplayName)
out.w(" platform: %s", ciPlatform)
out.w(" environment:")
if ciPlatform == "windows" {
out.w(` BAZEL_EXTRA_FLAGS: "--cxxopt=/std:c++17 --host_cxxopt=/std:c++17"`)
} else {
out.w(` BAZEL_EXTRA_FLAGS: "--cxxopt=-std=c++17 --host_cxxopt=-std=c++17"`)
}
if ciPlatform == "windows" {
out.w(" batch_commands:")
} else {
out.w(" shell_commands:")
out.w(" - set -x")
for _, flag := range extraPlatformFlags[ciPlatform] {
out.w(` - export BAZEL_EXTRA_FLAGS="%s $BAZEL_EXTRA_FLAGS"`, flag)
}
}
for _, rule := range lang.Rules {
if !doTestOnPlatform(lang, rule, ciPlatform) {
continue
}
if ciPlatform == "windows" {
// Windows has no make, so execute commands manually
out.w(" - echo %s", rule.Name)
out.w(" - cd %s", path.Join(dir, "examples", lang.Name, rule.Name))
if rule.IsTest {
out.w(" - bazel --batch test %%BAZEL_EXTRA_FLAGS%% --enable_runfiles --verbose_failures --test_output=errors --disk_cache=../../bazel-disk-cache //... || exit 1")
} else {
out.w(" - bazel --batch build %%BAZEL_EXTRA_FLAGS%% --enable_runfiles --verbose_failures --disk_cache=../../bazel-disk-cache //... || exit 1")
}
out.w(" - cd ../../..")
} else {
out.w(" - make %s_%s_example", lang.Name, rule.Name)
}
}
out.ln()
}
}
//
// Write tasks for test workspaces
//
for _, ciPlatform := range ciPlatforms {
out.w(" %s_test_workspaces:", ciPlatform)
out.w(" name: Test Workspaces")
out.w(" platform: %s", ciPlatform)
out.w(" environment:")
if ciPlatform == "windows" {
out.w(` BAZEL_EXTRA_FLAGS: "--cxxopt=/std:c++17 --host_cxxopt=/std:c++17"`)
} else {
out.w(` BAZEL_EXTRA_FLAGS: "--cxxopt=-std=c++17 --host_cxxopt=-std=c++17"`)
}
if ciPlatform == "windows" {
out.w(" batch_commands:")
} else {
out.w(" shell_commands:")
out.w(" - set -x")
}
for _, testWorkspace := range findTestWorkspaceNames(dir) {
if ciPlatform == "windows" {
// Windows has no make, so execute commands manually
out.w(" - echo %s", testWorkspace)
out.w(" - cd %s", path.Join(dir, "test_workspaces", testWorkspace))
out.w(" - bazel --batch test %%BAZEL_EXTRA_FLAGS%% --enable_runfiles --verbose_failures --test_output=errors --disk_cache=../bazel-disk-cache //... || exit 1")
out.w(" - cd ../..")
} else {
out.w(" - make test_workspace_%s", testWorkspace)
}
}
out.ln()
}
out.MustWrite(filepath.Join(dir, ".bazelci", "presubmit.yml"))
}
func mustWriteExamplesMakefile(dir string, languages []*Language) {
out := &LineWriter{}
var allNames []string
for _, lang := range languages {
var langNames []string
// Create rules for each example
for _, rule := range lang.Rules {
exampleDir := path.Join(dir, "examples", lang.Name, rule.Name)
var name = fmt.Sprintf("%s_%s_example", lang.Name, rule.Name)
allNames = append(allNames, name)
langNames = append(langNames, name)
out.w(".PHONY: %s", name)
out.w("%s:", name)
out.w(" cd %s; \\", exampleDir)
if rule.IsTest {
out.w(" bazel --batch test ${BAZEL_EXTRA_FLAGS} --verbose_failures --test_output=errors --disk_cache=../../bazel-disk-cache //...")
} else {
out.w(" bazel --batch build ${BAZEL_EXTRA_FLAGS} --verbose_failures --disk_cache=../../bazel-disk-cache //...")
}
out.ln()
}
// Create grouped rules for each language
targetName := fmt.Sprintf("%s_examples", lang.Name)
out.w(".PHONY: %s", targetName)
out.w("%s: %s", targetName, strings.Join(langNames, " "))
out.ln()
}
// Write all examples rule
out.w(".PHONY: all_examples")
out.w("all_examples: %s", strings.Join(allNames, " "))
out.ln()
out.MustWrite(filepath.Join(dir, "examples", "Makefile.mk"))
}
func mustWriteTestWorkspacesMakefile(dir string) {
out := &LineWriter{}
// For each test workspace, add makefile rule
var allNames []string
for _, testWorkspace := range findTestWorkspaceNames(dir) {
var name = fmt.Sprintf("test_workspace_%s", testWorkspace)
allNames = append(allNames, name)
out.w(".PHONY: %s", name)
out.w("%s:", name)
out.w(" cd %s; \\", path.Join(dir, "test_workspaces", testWorkspace))
out.w(" bazel --batch test ${BAZEL_EXTRA_FLAGS} --verbose_failures --disk_cache=../bazel-disk-cache --test_output=errors //...")
out.ln()
}
// Write all test workspaces rule
out.w(".PHONY: all_test_workspaces")
out.w("all_test_workspaces: %s", strings.Join(allNames, " "))
out.ln()
out.MustWrite(filepath.Join(dir, "test_workspaces", "Makefile.mk"))
}
func findTestWorkspaceNames(dir string) []string {
files, err := ioutil.ReadDir(filepath.Join(dir, "test_workspaces"))
if err != nil {
log.Fatal(err)
}
var testWorkspaces []string
for _, file := range files {
if file.IsDir() && !strings.HasPrefix(file.Name(), ".") && !strings.HasPrefix(file.Name(), "bazel-") {
testWorkspaces = append(testWorkspaces, file.Name())
}
}
return testWorkspaces
}