Skip to content

Commit b26d0d2

Browse files
committed
adds some new tables to database for faster rerun queries
1 parent 870575e commit b26d0d2

16 files changed

Lines changed: 633 additions & 346 deletions

File tree

docs/design/session-demo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,4 @@ for the increasingly diverse Canary user community. Some potential areas for fee
287287
* tjfulle: forcefully rerun if explicitly requests
288288
* tjfulle: should also run all downstreams
289289
* acrobin: restart-like capability to continue test that may have timed out
290+
* acrobin: --only=changed should work in new session

src/_canary/collect.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,10 @@ def generate_one(args) -> tuple[bool, "AbstractTestGenerator | None"]:
308308
except Exception:
309309
logger.exception(f"Failed to parse test from {root}/{f}")
310310
return False, None
311+
312+
313+
def find_generators_in_path(path: str | Path) -> list[AbstractTestGenerator]:
314+
collector = Collector()
315+
collector.add_scanpath(str(path), [])
316+
generators = collector.run()
317+
return generators

src/_canary/database.py

Lines changed: 179 additions & 55 deletions
Large diffs are not rendered by default.

src/_canary/plugins/subcommands/help.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def print_command_help(args: argparse.Namespace) -> None:
4949
def print_pathspec_help(args: argparse.Namespace) -> None:
5050
from .run import PathSpec
5151

52-
print(PathSpec.pathspec_help())
52+
print(PathSpec.canary_help())
5353

5454
@staticmethod
5555
def print_pathfile_help(args: argparse.Namespace) -> None:
56-
from .run import PathSpec
56+
from .run import ReadPathsFromFile
5757

58-
print(PathSpec.pathfile_help())
58+
print(ReadPathsFromFile.canary_help())

src/_canary/plugins/subcommands/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def print_tag_info(self, tag: str) -> None:
4343
fh = io.StringIO()
4444
fh.write(f"Tag: {tag}\n")
4545
selection = workspace.db.get_selection_metadata(tag)
46-
specs = [spec for spec in workspace.db.get_specs_by_tagname(tag) if not spec.mask]
46+
specs = [spec for spec in workspace.db.load_specs_by_tagname(tag) if not spec.mask]
4747
fh.write(f"Created on: {selection.created_on}\n")
4848
fh.write("Scan paths:\n")
4949
for root, paths in selection.scanpaths.items():

src/_canary/plugins/subcommands/rebaseline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Rebaseline(CanarySubcommand):
3333
@staticmethod
3434
def inview_dir(arg: str) -> str:
3535
workspace = Workspace.load()
36-
if workspace.inside_view(arg):
36+
if workspace.relative_to_view(arg):
3737
return arg
3838
raise ValueError(f"{arg}: is not in a view")
3939

0 commit comments

Comments
 (0)