|
17 | 17 | ) |
18 | 18 |
|
19 | 19 |
|
20 | | -@ci.command(help="Upload JUnit XML reports") |
| 20 | +@ci.command(help="Upload JUnit XML reports", deprecated="Use `junit-process` instead") |
21 | 21 | @click.option( |
22 | 22 | "--api-url", |
23 | 23 | "-u", |
@@ -75,6 +75,67 @@ async def junit_upload( # noqa: PLR0913 |
75 | 75 | ) |
76 | 76 |
|
77 | 77 |
|
| 78 | +@ci.command( |
| 79 | + help="""Upload JUnit XML reports and ignore failed tests with Mergify's CI Insights Quarantine""", |
| 80 | + short_help="""Upload JUnit XML reports and ignore failed tests with Mergify's CI Insights Quarantine""", |
| 81 | +) |
| 82 | +@click.option( |
| 83 | + "--api-url", |
| 84 | + "-u", |
| 85 | + help="URL of the Mergify API", |
| 86 | + required=True, |
| 87 | + envvar="MERGIFY_API_URL", |
| 88 | + default="https://api.mergify.com", |
| 89 | + show_default=True, |
| 90 | +) |
| 91 | +@click.option( |
| 92 | + "--token", |
| 93 | + "-t", |
| 94 | + help="CI Issues Application Key", |
| 95 | + required=True, |
| 96 | + envvar="MERGIFY_TOKEN", |
| 97 | +) |
| 98 | +@click.option( |
| 99 | + "--repository", |
| 100 | + "-r", |
| 101 | + help="Repository full name (owner/repo)", |
| 102 | + required=True, |
| 103 | + default=detector.get_github_repository, |
| 104 | +) |
| 105 | +@click.option( |
| 106 | + "--test-framework", |
| 107 | + help="Test framework", |
| 108 | +) |
| 109 | +@click.option( |
| 110 | + "--test-language", |
| 111 | + help="Test language", |
| 112 | +) |
| 113 | +@click.argument( |
| 114 | + "files", |
| 115 | + nargs=-1, |
| 116 | + required=True, |
| 117 | + type=click.Path(exists=True, dir_okay=False), |
| 118 | +) |
| 119 | +@utils.run_with_asyncio |
| 120 | +async def junit_process( # noqa: PLR0913 |
| 121 | + *, |
| 122 | + api_url: str, |
| 123 | + token: str, |
| 124 | + repository: str, |
| 125 | + test_framework: str | None, |
| 126 | + test_language: str | None, |
| 127 | + files: tuple[str, ...], |
| 128 | +) -> None: |
| 129 | + await _process_junit_files( |
| 130 | + api_url=api_url, |
| 131 | + token=token, |
| 132 | + repository=repository, |
| 133 | + test_framework=test_framework, |
| 134 | + test_language=test_language, |
| 135 | + files=files, |
| 136 | + ) |
| 137 | + |
| 138 | + |
78 | 139 | async def _process_junit_files( # noqa: PLR0913 |
79 | 140 | *, |
80 | 141 | api_url: str, |
|
0 commit comments