forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_build_cmd_rust.py
More file actions
68 lines (61 loc) · 2.01 KB
/
Copy pathtest_build_cmd_rust.py
File metadata and controls
68 lines (61 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"""
Integration test cases for `sam build` for Rust (cargo-lambda)
"""
import logging
from unittest import skipIf
import pytest
from parameterized import parameterized
from tests.testing_utils import (
IS_WINDOWS,
RUNNING_ON_CI,
CI_OVERRIDE,
SKIP_DOCKER_TESTS,
SKIP_DOCKER_BUILD,
SKIP_DOCKER_MESSAGE,
)
from tests.integration.buildcmd.build_integ_base import (
BuildIntegRustBase,
rust_parameterized_class,
show_container_in_test_name,
)
LOG = logging.getLogger(__name__)
@skipIf(
((IS_WINDOWS and RUNNING_ON_CI) and not CI_OVERRIDE),
"Skip build tests on windows when running in CI unless overridden",
)
@rust_parameterized_class
class TestBuildCommand_Rust(BuildIntegRustBase):
@parameterized.expand(
[
("provided.al2", "x86_64", None, False),
("provided.al2", "x86_64", "debug", False),
("provided.al2023", "x86_64", None, False),
("provided.al2023", "x86_64", "debug", False),
],
name_func=show_container_in_test_name,
)
def test_build(self, runtime, architecture, build_mode, use_container):
self._test_with_rust_cargo_lambda(
runtime=runtime,
code_uri=self.code_uri,
binary=self.binary,
architecture=architecture,
build_mode=build_mode,
expected_invoke_result=self.expected_invoke_result,
use_container=use_container,
)
@pytest.mark.tier1_extra
def test_tier1_rust_build(self):
"""Single Rust build test for cross-platform validation.
Note: Rust/cargo-lambda does not support --use-container builds
(the build container doesn't have cargo installed).
"""
self._test_with_rust_cargo_lambda(
runtime="provided.al2023",
code_uri=self.code_uri,
binary=self.binary,
architecture="x86_64",
build_mode=None,
expected_invoke_result=self.expected_invoke_result,
use_container=False,
)