-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support package driver running within test dirs (#188)
* split up methods * tie it up * Working on an in-repo test * Clean things up * version * can't remember what I added this for
- Loading branch information
1 parent
002b60d
commit 4691ace
Showing
6 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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,18 @@ | ||
remote_file( | ||
name = "gosec_download", | ||
url = ["https://github.com/securego/gosec/releases/download/v2.14.0/gosec_2.14.0_linux_amd64.tar.gz"], | ||
hashes = ["226bd8825b7aed3d454446d1ec094f817f37859dded4211a5b707d0f36c5fdb7"], | ||
test_only = True, | ||
) | ||
|
||
genrule( | ||
name = "gosec", | ||
srcs = [":gosec_download"], | ||
tools = [CONFIG.ARCAT_TOOL], | ||
outs = ["gosec"], | ||
cmd = "$TOOLS x $SRCS -s v2.14.0", | ||
binary = True, | ||
test_only = True, | ||
visibility = ["//tools/driver/..."], | ||
) | ||
|
This file contains 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 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 |
---|---|---|
@@ -1 +1 @@ | ||
0.2.3 | ||
0.3.0 |
This file contains 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 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 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,26 @@ | ||
subinclude("//build_defs:go") | ||
|
||
# This is an integration test proving we can run within a test directory; without the | ||
# package driver running, gosec will get import errors from the package and fail. | ||
gentest( | ||
name = "gosec_test", | ||
tools = { | ||
"driver": ["//tools/driver:plz-gopackagesdriver"], | ||
"gosec": ["//third_party/binary:gosec"], | ||
}, | ||
deps = [ | ||
"//tools/driver/packages", | ||
], | ||
needs_transitive_deps = True, | ||
cmd = [ | ||
'export PLZ_GOPACKAGESDRIVER_SEARCHDIR="$TMP_DIR"', | ||
'export GOPACKAGESDRIVER="$TOOLS_DRIVER"', | ||
'"$TOOLS_GOSEC" --exclude G104,G304,G307 tools/driver/packages', | ||
], | ||
test_cmd = "true", | ||
no_test_output = True, | ||
requires = [ | ||
"go", | ||
"go_src", | ||
], | ||
) |