Skip to content

FlorianLehmann/smartest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smartest

Compiling

To compile smartest, you need a Java Development Kit (JDK), Maven and clone the repository:

cd smartest
mvn clean package

Execution

cd target
java -jar smartest.jar

Flags

flag Description
-h, --help Show this help message and exit.
-v, --version Print version information and exit.
--config-path= Set path to config.smt file

Options

option Description
list-tests List the tests that cover the changes between commits.
test Run tests on the selected scope.
commit Run tests then record changes to the repository.

List Tests

Usage: smartest list-tests [-s=<scope>] List the tests that cover the changes between commits.

flag Description
-s, --scope Give the scope of the analysis (class, method, method and dependencies...), therefore only the test of this scope will be listed

Test

Usage: smartest test [-s=<scope>] Run tests on the selected scope.

flag Description
-s, --scope Give the scope of the analysis (class, method, method and dependencies...), therefore only the test of this scope will be executed

Commit

Usage: smartest commit -m=<message> [-s=<scope>] Run tests and then commit changes to the repository.

flag Description
-m, --message=<message> Use the given <msg> as the commit message
-s, --scope=<scope> Give the scope of the analysis (class, method, method and dependencies...), therefore only the test of this scope will be executed

Plugins

Smartest supports plugins for the language parsing (Java, Python), the production tool (Maven, Gradle), the test framework (Junit, Pytest) and the vcs (git, svn). We provide an implement for Java as a language, Maven as a production tool, Junit5 as a test framework and git as a vcs. If you want to create your own plugin, you have to implement one of the following interfaces and put the jar of your plugin in the plugins directory. The path to the plugins directory can be changed in the config.smt of your project.

Dependency

To create your own plugin, firstly, add the Maven dependency to the plugin project

<dependency>
    <groupId>fr.smartest</groupId>
    <artifactId>plugin</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Implement on of the following interfaces

Plugin Interfaces (Common)

public interface Plugin {
    boolean accept(String identifier);
}

The accept method has to return true if the identifier given correspond to your plugin. For example, a Java plugin should return true if the identifier is java and false otherwise.

Language

interface Language extends Plugin {
    void setUp(List<Module> modules);
    Set<Test> getTestsRelatedToChanges(String scope, Set<Diff> diff);
    void save();
}

Production Tool

public interface ProductionTool extends Plugin{
    void setUp(String path);
    List<Module> getModules();
    void compile() throws ProductionToolException;
}

Test Framework

public interface TestFramework extends Plugin {
    void setUp(String path, List<Module> modules);
    Set<TestReport> run(Set<Test> tests) throws TestFrameworkException;
}

VCS

public interface VCS extends Plugin {
    void setUp(String VCSpath);
    void commit(String message) throws VCSException;
    Set<Diff> diff() throws VCSException;
    void checkout(String version);
    void update();
}

Add it to Smartest

Compile and package your plugin to a jar and then put it in the plugin directory of your project. Put the corresponding identifier of your plugin in the config.smt of your project. You are ready to go !

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published