File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
aws_lambda_builders/workflows/go_modules
tests/unit/workflows/go_modules Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ install:
30
30
31
31
# setup go
32
32
- rmdir c:\go /s /q
33
- - " choco install golang --version 1.11.5 "
33
+ - " choco install golang"
34
34
- " choco install bzr"
35
35
- " choco install dep"
36
36
- setx PATH "C:\go\bin;C:\gopath\bin;C:\Program Files (x86)\Bazaar\;C:\Program Files\Mercurial;%PATH%;"
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def validate(self, runtime_path):
53
53
out_parts = out .decode ().split ()
54
54
if len (out_parts ) >= 3 :
55
55
version_parts = [int (x ) for x in out_parts [2 ].replace (self .LANGUAGE , "" ).split ('.' )]
56
- if len (version_parts ) == 3 :
56
+ if len (version_parts ) >= 2 :
57
57
if version_parts [0 ] == expected_major_version and version_parts [1 ] >= min_expected_minor_version :
58
58
self ._valid_runtime_path = runtime_path
59
59
return self ._valid_runtime_path
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ def test_runtime_validate_supported_version_runtime(self):
40
40
self .validator .validate (runtime_path = "/usr/bin/go" )
41
41
self .assertTrue (mock_subprocess .call_count , 1 )
42
42
43
+ def test_runtime_validate_supported_higher_than_min_version_runtime (self ):
44
+ with mock .patch ("subprocess.Popen" ) as mock_subprocess :
45
+ mock_subprocess .return_value = MockSubProcess (0 , out = b"go version go1.12 test" )
46
+ self .validator .validate (runtime_path = "/usr/bin/go" )
47
+ self .assertTrue (mock_subprocess .call_count , 1 )
48
+
43
49
def test_runtime_validate_mismatch_nonzero_exit (self ):
44
50
with mock .patch ("subprocess.Popen" ) as mock_subprocess :
45
51
mock_subprocess .return_value = MockSubProcess (1 )
You can’t perform that action at this time.
0 commit comments