Skip to content

Latest commit

 

History

History
28 lines (15 loc) · 1.06 KB

ARCHITECTURE.md

File metadata and controls

28 lines (15 loc) · 1.06 KB

Architecture

this is an architecture file, which outlines the general structure of this codebase.

Structure

The goal of the library is to, given a list of files, determine the relevant test command to run using machine learning a big if-else statement.

Context

in context.py

When the root command (t) is run, it collects information about the directory it's been run in. It's passed to the other methods and helps with determining which files are present and their contents.

Commands

in commands.py

Each available test command (such as npm test or pytest) has a corresponding Command instance. They each hold:

  • a function to determine if, based on a given context, this command should be run
  • the resulting test command

Picking a command

in commands.py

find_test_command is the aforementioned "big if statement", which is technically a return in a loop. For each command, if command.should_run(context) is True, the object is returned (and executed).