Skip to content

Commit 8f62d7f

Browse files
authored
Added build tests for generating multiple targets (#23)
* Added build tests for generating multiple targets These builds are useful for intensively test the platform - One genrule creating dummy text files - One genrule for copying pdf copies - One genrule for copying compressed files - One genrule for copying iso images * Updated number of generated targets * Removed comments and added shared variable for genrule tests * Added one more comment and changed 2021 for 2022
1 parent 12a76e1 commit 8f62d7f

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

WORKSPACE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
2+
3+
http_file(
4+
name = "emacs",
5+
urls = ["https://mirror.its.dal.ca/gnu/emacs/emacs-28.1.tar.gz",
6+
"https://mirrors.kernel.org/gnu/emacs/emacs-28.1.tar.gz"],
7+
sha256 = "1439bf7f24e5769f35601dbf332e74dfc07634da6b1e9500af67188a92340a28"
8+
)
9+
10+
http_file(
11+
name = "ubuntu_20.04_1.3GB",
12+
urls = ["https://mirror.math.princeton.edu/pub/ubuntu-iso/focal/ubuntu-20.04.4-live-server-amd64.iso",
13+
"https://mirror.pit.teraswitch.com/ubuntu-releases/focal/ubuntu-20.04.4-live-server-amd64.iso"],
14+
sha256 = "28ccdb56450e643bad03bb7bcf7507ce3d8d90e8bf09e38f6bd9ac298a98eaad"
15+
)

genrules/BUILD

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2022 EngFlow Inc. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# The following genrules are able to produce thousands of targets based
16+
# on the user's input.
17+
# This can be used for stress testing your build infrastructure.
18+
# Change the upper bound of the range and enjoy!
19+
UPPER_BOUND = 10
20+
[genrule(
21+
name = "foo_TXT_4KB_" + str(x),
22+
outs = ["foo_text" + str(x) + ".txt"],
23+
cmd = "echo 'Hello engflow world' > $@",
24+
) for x in range(1,UPPER_BOUND)]
25+
26+
[genrule(
27+
name = "gnu-manifesto_PDF_76KB" + str(x),
28+
outs = ["gnu-manifesto" + str(x) + ".pdf"],
29+
cmd = "cp $(location gnu-manifesto.pdf) $@",
30+
tools = ["gnu-manifesto.pdf"]
31+
) for x in range(1,UPPER_BOUND)]
32+
33+
[genrule(
34+
name = "emacs_TARGZ_68MB" + str(x),
35+
outs = ["emacs" + str(x) + ".tar.gz"],
36+
cmd = "cp $(location @emacs//file) $@",
37+
tools = ["@emacs//file"]
38+
) for x in range(1,UPPER_BOUND)]
39+
40+
[genrule(
41+
name = "ubuntu_20.04_1.3GB" + str(x),
42+
outs = ["ubuntu_20.04_1.3GB" + str(x) + ".iso"],
43+
cmd = "cp $(location @ubuntu_20.04_1.3GB//file) $@",
44+
tools = ["@ubuntu_20.04_1.3GB//file"]
45+
) for x in range(1,2)]

genrules/gnu-manifesto.pdf

74.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)