Skip to content
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

Expand marker for model validation tests and add ability to run via the CI script #9131

Open
wants to merge 2 commits into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions scripts/ci/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def process_args(args):
f"--cov-config={os.path.join(REPO_ROOT, '.coveragerc')} "
f"--cov-report xml "
)
if args.junit_xml_path:
test_args += f'--junit-xml={args.junit_xml_path} '
if args.markers:
test_args += f'-m {args.markers} '
test_args += '--numprocesses=auto --dist=loadfile --maxprocesses=4 '
dirs = " ".join(args.test_dirs)

Expand Down Expand Up @@ -102,6 +106,19 @@ if __name__ == "__main__":
"Optional path to an alternate test directory to use."
)
)
parser.add_argument(
"--junit-xml-path",
default=None,
type=os.path.abspath,
help="Optional path to output a JUnit XML result file to."
)
parser.add_argument(
"-m",
"--markers",
default=None,
help="Run all tests decorated with the specified marker expression."
)

raw_args = parser.parse_args()
test_runner, test_args, test_dirs = process_args(raw_args)

Expand Down
2 changes: 2 additions & 0 deletions tests/functional/botocore/test_h2_required.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ def _all_test_cases():
H2_SERVICES, H2_OPERATIONS = _all_test_cases()


@pytest.mark.validates_models
@pytest.mark.parametrize("h2_service", H2_SERVICES)
def test_all_uses_of_h2_are_known(h2_service):
# Validates that a service that requires HTTP 2 for all operations is known
message = 'Found unknown HTTP 2 service: %s' % h2_service
assert _KNOWN_SERVICES.get(h2_service) is _H2_REQUIRED, message


@pytest.mark.validates_models
@pytest.mark.parametrize("h2_service, operation", H2_OPERATIONS)
def test_all_h2_operations_are_known(h2_service, operation):
# Validates that an operation that requires HTTP 2 is known
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/botocore/test_paginator_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def _pagination_configs():
service_model
)


@pytest.mark.validates_models
@pytest.mark.parametrize(
"operation_name, page_config, service_model",
_pagination_configs()
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/test_no_event_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import pytest
from botocore.model import OperationModel

from awscli.clidriver import create_clidriver
Expand All @@ -21,6 +22,7 @@
]


@pytest.mark.validates_models
def test_no_event_stream_unless_allowed():
driver = create_clidriver()
help_command = driver.create_help_command()
Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_shadowing.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def _generate_command_tests():
yield command_name, sub_help.command_table, top_level_params


@pytest.mark.validates_models
@pytest.mark.parametrize(
"command_name, command_table, builtins",
_generate_command_tests()
Expand Down
Loading