Skip to content

Commit 60a888f

Browse files
authored
Merge pull request #1210 from cloudbees-oss/forward-port-from-v1-1202
forward port from v1
2 parents a2e57a7 + acb4b08 commit 60a888f

File tree

14 files changed

+513
-239
lines changed

14 files changed

+513
-239
lines changed

smart_tests/jar/exe_deploy.jar

2.78 KB
Binary file not shown.

smart_tests/test_runners/karma.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This runner only supports recording tests
2-
# For subsetting, use 'ng' test runner instead
3-
# It's possible to use 'karma' runner for recording, and 'ng' runner for subsetting, for the same test session
41
import json
52
from typing import Annotated, Dict, Generator, List
63

@@ -12,18 +9,6 @@
129
from . import smart_tests
1310

1411

15-
@smart_tests.subset
16-
def subset(client, _with: Annotated[str | None, typer.Option(
17-
'--with', help="Specify 'ng' to use the Angular test runner for subsetting")] = None, ):
18-
# TODO: implement the --with ng option
19-
20-
# read lines as test file names
21-
for t in client.stdin():
22-
client.test_path(t.rstrip("\n"))
23-
24-
client.run()
25-
26-
2712
@smart_tests.record.tests
2813
def record_tests(client,
2914
reports: Annotated[List[str], typer.Argument(multiple=True, help="Test report files to process")],
@@ -32,6 +17,28 @@ def record_tests(client,
3217

3318
for r in reports:
3419
client.report(r)
20+
client.run()
21+
22+
23+
@smart_tests.subset
24+
def subset(client, _with: Annotated[str | None, typer.Option(
25+
'--with', help='Format output for specific test runner (e.g., "ng" for Angular CLI)')] = None, ):
26+
"""
27+
Usage:
28+
find src -name "*.spec.ts" -o -name "*.spec.js" > test-list.txt
29+
cat test-list.txt | launchable subset --target 10% karma
30+
31+
# Output in ng test format
32+
find src -name "*.spec.ts" | launchable subset --target 10% karma --with ng
33+
"""
34+
for t in client.stdin():
35+
path = t.strip()
36+
if path:
37+
client.test_path(path)
38+
39+
if _with == 'ng':
40+
client.formatter = lambda x: "--include={}".format(x[0]['name'])
41+
client.separator = " "
3542

3643
client.run()
3744

smart_tests/test_runners/ng.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/main/java/com/launchableinc/ingest/commits/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ java_library(
2121

2222
java_binary(
2323
name = "exe",
24-
main_class = "com.launchableinc.ingest.commits.CommitIngester",
24+
main_class = "com.launchableinc.ingest.commits.Main",
2525
runtime_deps = [
2626
":commits",
2727
"@maven//:org_slf4j_slf4j_jdk14",

0 commit comments

Comments
 (0)