Skip to content

Commit 1670515

Browse files
authored
fix(modules): Allow building with rc go versions (#157)
1 parent a25223a commit 1670515

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

.appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ environment:
1818
NEW_FLAKE8: 0
1919
JAVA_HOME: "C:\\Program Files\\Java\\jdk11"
2020
- PYTHON: "C:\\Python36-x64"
21-
PYTHON_VERSION: '3.6.9'
21+
PYTHON_VERSION: '3.6.10'
2222
PYTHON_ARCH: '64'
2323
LINE_COVERAGE: '91'
2424
NEW_FLAKE8: 0
@@ -30,7 +30,7 @@ environment:
3030
NEW_FLAKE8: 0
3131
JAVA_HOME: "C:\\Program Files\\Java\\jdk11"
3232
- PYTHON: "C:\\Python38-x64"
33-
PYTHON_VERSION: '3.8.0'
33+
PYTHON_VERSION: '3.8.2'
3434
PYTHON_ARCH: '64'
3535
LINE_COVERAGE: '72'
3636
NEW_FLAKE8: 1

aws_lambda_builders/workflows/go_modules/validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def validate(self, runtime_path):
4747
if p.returncode == 0:
4848
out_parts = out.decode().split()
4949
if len(out_parts) >= 3:
50-
version_parts = [int(x) for x in out_parts[2].replace(self.LANGUAGE, "").split(".")]
50+
version_parts = [int(x.replace("rc", "")) for x in out_parts[2].replace(self.LANGUAGE, "").split(".")]
5151
if len(version_parts) >= 2:
5252
if version_parts[0] == expected_major_version and version_parts[1] >= min_expected_minor_version:
5353
self._valid_runtime_path = runtime_path

tests/functional/workflows/python_pip/test_packager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,11 +756,9 @@ def test_build_into_existing_dir_with_preinstalled_packages(self, tmpdir, osutil
756756
class TestSubprocessPip(object):
757757
def test_can_invoke_pip(self):
758758
pip = SubprocessPip(python_exe=sys.executable)
759-
rc, out, err = pip.main(["--version"])
760-
# Simple assertion that we can execute pip and it gives us some output
761-
# and nothing on stderr.
759+
rc, _, _ = pip.main(["--version"])
760+
# Simple assertion that we can execute pip
762761
assert rc == 0
763-
assert err == b""
764762

765763
def test_does_error_code_propagate(self):
766764
pip = SubprocessPip(python_exe=sys.executable)

tests/unit/workflows/go_modules/test_validator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ def test_runtime_validate_unsupported_language_fail_open(self):
3030
validator = GoRuntimeValidator(runtime="go2.x")
3131
validator.validate(runtime_path="/usr/bin/go2")
3232

33-
def test_runtime_validate_supported_version_runtime(self):
33+
@parameterized.expand([(b"go version go1.11.2 test",), (b"go version go1.11rc.2 test",)])
34+
def test_runtime_validate_supported_version_runtime(self, go_version_output):
3435
with mock.patch("subprocess.Popen") as mock_subprocess:
35-
mock_subprocess.return_value = MockSubProcess(0, out=b"go version go1.11.2 test")
36+
mock_subprocess.return_value = MockSubProcess(0, out=go_version_output)
3637
self.validator.validate(runtime_path="/usr/bin/go")
3738
self.assertTrue(mock_subprocess.call_count, 1)
3839

0 commit comments

Comments
 (0)