-
Notifications
You must be signed in to change notification settings - Fork 212
Implement e2e tests for export functionality #3506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DuBento
wants to merge
33
commits into
thought-machine:master
Choose a base branch
from
DuBento:export-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
415d31e
test: initial build statement testing
b071dad
test: move to export_e2e build rule
451ecdf
test: add test for custom build def and rework build stmt checked
6066dce
test: targets with deps, multiple targets, export outputs and notrim
db74e8a
test: export go binary including rework of build_def for multiple plz…
55756b9
test: genrule with go subrepo and go binary with go dependency
10aa8f3
test: build def with children targets
b561575
test: preload build def
7bf2255
lint: run plz format
58bf895
fix: plz command replacement for tests cmd
9b19c4a
nit comments
de23d20
test export build def
451f4eb
first golden-master test and moved export_e2e to generic test
51a1c24
update test simple custom build def to use repo diff
9544043
update test build defs for in file and extra child
c1e5e51
update deps test
6e3c11b
update multiple targets and preload tests
0a24446
update go tests
622797d
update generic tests
0c0c68a
remove old repos
468f5cd
doc string
14c93bc
linter
501a82f
rename test_repo to source_repo
6b6b182
enforce differences between source and expected repo
60b1fa4
include trimable target for all tests
2560764
build all targets in the exported repo
621ec1a
move tests into each test dir
3d18551
rename child to adjacent
54adcb1
reduce go_binary test
a14d7f9
output test as golden-master
9d703d7
move go config and binary to source_repo
c09f60a
notrim test as golden-master
4f142bc
format
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| subinclude("//test/build_defs:build_defs") | ||
|
|
||
| def please_export_e2e_test( | ||
| name:str, | ||
| export_targets:list, | ||
| cmd_on_export:list=[], | ||
| source_repo:str="source_repo", | ||
| expected_repo:str="expected_repo", | ||
| flags:str="", | ||
| enforce_different_repos:bool=True): | ||
| """ | ||
| Runs an export e2e test. To use it, create a directory with both a `source_repo` with the targets | ||
| to be exported and an `expected_repo` with the expected resulting files. | ||
| The validation steps for the e2e test are: | ||
| * It performs a repo-wide diff between the exported files and the `expected_repo` | ||
| * Builds the exported target to ensure the exported repo, and consequently the | ||
| `expected_repo`, include valid sources and dependencies to build the target. | ||
| * Optionally you can specify additional commands to run on the exported directory by | ||
| passing them to `cmd_on_export`. | ||
|
|
||
| Args: | ||
| name (str): Name of the test. | ||
| export_targets (list): Targets to export as part of the test. | ||
| cmd_on_export (list): Optional. Additional commands to run on the exported directory. | ||
| source_repo (str): Optional. Repository to export targets from. Defaults to "source_repo". | ||
| expected_repo (str): Optional. Repository containing the expected results for golden-master | ||
| validation. Defaults to "expected_repo". | ||
| flags (str): Optional. Additional flags for the export command. | ||
| enforce_different_repos (bool): Optional. Ensures we test the trimming capabilities of the | ||
| export by enforcing that the source and expected repos differ in content. Default to True. | ||
| """ | ||
| EXPORT_DIR = "plz-out/plzexport" | ||
| exported_repo = f"$DATA_SOURCE_REPO/{EXPORT_DIR}" | ||
| data = {} | ||
| tools = {} | ||
|
|
||
| targets = " ".join(export_targets) | ||
|
|
||
| test_cmd = [] | ||
| if enforce_different_repos: | ||
| test_cmd += [ | ||
| # Enforce source_repo and expected_repo differences | ||
| f'(diff -rq "$DATA_SOURCE_REPO" "$DATA_EXPECTED_REPO" && \ | ||
| echo "Source and Expected repos must differ" && exit 1 || true)', | ||
| ] | ||
|
|
||
| test_cmd += [ | ||
| # Export | ||
| f'plz --repo_root="$DATA_SOURCE_REPO" export --output "{EXPORT_DIR}" {flags} {targets}', | ||
| # Golden-Master validation with expected repo. Done before any building to avoid plz-out | ||
| f'diff -ru "{exported_repo}" "$DATA_EXPECTED_REPO"', | ||
| # Tests building the exported repo which in turn ensures the sources are included | ||
| f'plz --repo_root="{exported_repo}" build //...', | ||
| ] + [f'plz --repo_root="{exported_repo}" {cmd}' for cmd in cmd_on_export] | ||
|
|
||
| test_cmd = [cmd.replace("plz ", "$TOOLS_PLEASE ") for cmd in test_cmd] | ||
| test_cmd = " && ".join(test_cmd) | ||
|
|
||
| data["SOURCE_REPO"] = [source_repo] | ||
| data["EXPECTED_REPO"] = [expected_repo] | ||
|
|
||
| tools["PLEASE"] = ["//package:installed_files|please"] | ||
|
|
||
| return gentest( | ||
| name = name, | ||
| data = data, | ||
| labels = ["plz_e2e_test", "e2e"], | ||
| no_test_output = True, | ||
| sandbox = False, | ||
| test_cmd = test_cmd, | ||
| test_tools = tools, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subinclude("//test/export:export_e2e_test_build_def") | ||
|
|
||
| # Export a target generated by a native genrule target and trim unused | ||
| # build statements. | ||
| please_export_e2e_test( | ||
| name = "export_native_genrule", | ||
| export_targets = ["//:native_genrule"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [Parse] | ||
|
|
||
| BuildFileName = BUILD_FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| genrule( | ||
| name = "native_genrule", | ||
| srcs = ["file.txt"], | ||
| outs = ["file.wordcount"], | ||
| cmd = "wc $SRCS > $OUT", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Test source file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [Parse] | ||
|
|
||
| BuildFileName = BUILD_FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| genrule( | ||
| name = "native_genrule", | ||
| srcs = ["file.txt"], | ||
| outs = ["file.wordcount"], | ||
| cmd = "wc $SRCS > $OUT", | ||
| ) | ||
|
|
||
| genrule( | ||
| name = "dummy_target_to_be_trimmed", | ||
| srcs = ["dummy.txt"], | ||
| outs = ["dummy"], | ||
| cmd = "cat $SRCS > $OUT", | ||
| ) |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Test source file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subinclude("//test/export:export_e2e_test_build_def") | ||
|
|
||
| # Export a target generated by a custom build def. | ||
| please_export_e2e_test( | ||
| name = "export_simple_custom_target", | ||
| export_targets = ["//:simple_custom_target"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [Parse] | ||
|
|
||
| BuildFileName = BUILD_FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subinclude("//build_defs:simple_build_def") | ||
|
|
||
| simple_custom_target( | ||
| name = "simple_custom_target", | ||
| srcs = ["file.txt"], | ||
| outs = ["file_simple.out"], | ||
| ) |
5 changes: 5 additions & 0 deletions
5
test/export/test_custom_def/expected_repo/build_defs/BUILD_FILE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| filegroup( | ||
| name = "simple_build_def", | ||
| srcs = ["simple.build_defs"], | ||
| visibility = ["PUBLIC"], | ||
| ) | ||
10 changes: 10 additions & 0 deletions
10
test/export/test_custom_def/expected_repo/build_defs/simple.build_defs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| def simple_custom_target( | ||
| name:str, | ||
| srcs:list=[], | ||
| outs:list=[]): | ||
| return genrule( | ||
| name = name, | ||
| srcs = srcs, | ||
| outs = outs, | ||
| cmd = "cat $SRCS > $OUT", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Test source file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [Parse] | ||
|
|
||
| BuildFileName = BUILD_FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| subinclude("//build_defs:simple_build_def") | ||
|
|
||
| simple_custom_target( | ||
| name = "simple_custom_target", | ||
| srcs = ["file.txt"], | ||
| outs = ["file_simple.out"], | ||
| ) | ||
|
|
||
| simple_custom_target( | ||
| name = "dummy", | ||
| srcs = ["file.txt"], | ||
| outs = ["dummy.out"], | ||
| ) |
11 changes: 11 additions & 0 deletions
11
test/export/test_custom_def/source_repo/build_defs/BUILD_FILE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| filegroup( | ||
| name = "simple_build_def", | ||
| srcs = ["simple.build_defs"], | ||
| visibility = ["PUBLIC"], | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "dummy_build_def", | ||
| srcs = ["dummy.build_defs"], | ||
| visibility = ["PUBLIC"], | ||
| ) |
8 changes: 8 additions & 0 deletions
8
test/export/test_custom_def/source_repo/build_defs/dummy.build_defs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| def dummy_target( | ||
| name:str, | ||
| outs:list=[]): | ||
| return genrule( | ||
| name = name, | ||
| outs = outs, | ||
| cmd = "echo dummy > $OUT", | ||
| ) |
10 changes: 10 additions & 0 deletions
10
test/export/test_custom_def/source_repo/build_defs/simple.build_defs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| def simple_custom_target( | ||
| name:str, | ||
| srcs:list=[], | ||
| outs:list=[]): | ||
| return genrule( | ||
| name = name, | ||
| srcs = srcs, | ||
| outs = outs, | ||
| cmd = "cat $SRCS > $OUT", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Test source file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| subinclude("//test/export:export_e2e_test_build_def") | ||
|
|
||
| # Export a target generated by a custom build def. | ||
| please_export_e2e_test( | ||
| name = "export_custom_with_adjacent_target", | ||
| cmd_on_export = [ | ||
| # Adjacent target of build def | ||
| "build //:custom_target#adjacent", | ||
| ], | ||
| export_targets = ["//:custom_target"], | ||
| ) |
3 changes: 3 additions & 0 deletions
3
test/export/test_custom_def_children/expected_repo/.plzconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [Parse] | ||
|
|
||
| BuildFileName = BUILD_FILE |
8 changes: 8 additions & 0 deletions
8
test/export/test_custom_def_children/expected_repo/BUILD_FILE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subinclude("//build_defs:custom_build_def") | ||
|
|
||
| custom_target( | ||
| name = "custom_target", | ||
| srcs = ["file.txt"], | ||
| outs = ["file.out"], | ||
| outs_adjacent = ["file_adjacent.out"], | ||
| ) |
5 changes: 5 additions & 0 deletions
5
test/export/test_custom_def_children/expected_repo/build_defs/BUILD_FILE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| filegroup( | ||
| name = "custom_build_def", | ||
| srcs = ["custom.build_defs"], | ||
| visibility = ["PUBLIC"], | ||
| ) |
17 changes: 17 additions & 0 deletions
17
test/export/test_custom_def_children/expected_repo/build_defs/custom.build_defs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| def custom_target( | ||
| name:str, | ||
| srcs:list=[], | ||
| outs:list=[], | ||
| outs_adjacent:list=[]): | ||
| genrule( | ||
| name = f"{name}#adjacent", | ||
| srcs = srcs, | ||
| outs = outs_adjacent, | ||
| cmd = "echo 'adjacent' > $OUT && cat $SRCS >> $OUT ", | ||
| ) | ||
| return genrule( | ||
| name = name, | ||
| srcs = srcs, | ||
| outs = outs, | ||
| cmd = "echo 'main' > $OUT && cat $SRCS >> $OUT ", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Test source file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [Parse] | ||
|
|
||
| BuildFileName = BUILD_FILE |
15 changes: 15 additions & 0 deletions
15
test/export/test_custom_def_children/source_repo/BUILD_FILE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| subinclude("//build_defs:custom_build_def") | ||
|
|
||
| custom_target( | ||
| name = "custom_target", | ||
| srcs = ["file.txt"], | ||
| outs = ["file.out"], | ||
| outs_adjacent = ["file_adjacent.out"], | ||
| ) | ||
|
|
||
| custom_target( | ||
| name = "dummy", | ||
| srcs = ["file.txt"], | ||
| outs = ["dummy.out"], | ||
| outs_adjacent = ["dummy_adjacent.out"], | ||
| ) |
5 changes: 5 additions & 0 deletions
5
test/export/test_custom_def_children/source_repo/build_defs/BUILD_FILE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| filegroup( | ||
| name = "custom_build_def", | ||
| srcs = ["custom.build_defs"], | ||
| visibility = ["PUBLIC"], | ||
| ) |
17 changes: 17 additions & 0 deletions
17
test/export/test_custom_def_children/source_repo/build_defs/custom.build_defs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| def custom_target( | ||
| name:str, | ||
| srcs:list=[], | ||
| outs:list=[], | ||
| outs_adjacent:list=[]): | ||
| genrule( | ||
| name = f"{name}#adjacent", | ||
| srcs = srcs, | ||
| outs = outs_adjacent, | ||
| cmd = "echo 'adjacent' > $OUT && cat $SRCS >> $OUT ", | ||
| ) | ||
| return genrule( | ||
| name = name, | ||
| srcs = srcs, | ||
| outs = outs, | ||
| cmd = "echo 'main' > $OUT && cat $SRCS >> $OUT ", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Test source file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subinclude("//test/export:export_e2e_test_build_def") | ||
|
|
||
| # Export a target generated by a custom build def defined in the same | ||
| # BUILD file. | ||
| please_export_e2e_test( | ||
| name = "export_custom_target_in_file", | ||
| export_targets = ["//:simple_custom_target"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [Parse] | ||
|
|
||
| BuildFileName = BUILD_FILE |
13 changes: 13 additions & 0 deletions
13
test/export/test_custom_in_file_def/expected_repo/BUILD_FILE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| filegroup( | ||
| name = "simple_build_def", | ||
| srcs = ["simple.build_defs"], | ||
| visibility = ["//test_custom_defs/..."], | ||
| ) | ||
|
|
||
| subinclude(":simple_build_def") | ||
|
|
||
| simple_custom_target( | ||
| name = "simple_custom_target", | ||
| srcs = ["file.txt"], | ||
| outs = ["file_simple.out"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Test source file |
10 changes: 10 additions & 0 deletions
10
test/export/test_custom_in_file_def/expected_repo/simple.build_defs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| def simple_custom_target( | ||
| name:str, | ||
| srcs:list=[], | ||
| outs:list=[]): | ||
| return genrule( | ||
| name = name, | ||
| srcs = srcs, | ||
| outs = outs, | ||
| cmd = "cat $SRCS > $OUT", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [Parse] | ||
|
|
||
| BuildFileName = BUILD_FILE |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.