time_commit: Test file's run-time.

View source: R/repo_metrics.R

time_commitR Documentation

Test file's run-time.

Description

Given a test-file's path, measures its run-time against the commit specified by the commit object passed as a parameter.

Usage

time_commit(test_path, test_commit)

Arguments

test_path

File-path for the test file whose run-time is to be checked.

test_commit

git2r commit object corresponding to which the run-time is to be checked.

Value

time_commit returns an object of class "data.frame". The data-frame consists of the following columns: test_name metric_name status metric_val message sha date_time

Warning

Function assumes the current directory to be the root directory of the package being tested.

See Also

commits

Examples

## Not run: 
## Example-1

# Set the current directory to the git repository concerned.
setwd("./Path/to/repository")

# Obtain the commit object
commit_list <- git2r::commits()
t_commit <- commit_list[[1]]

# Specify the test-file path
t_path <- "Path/to/file"

# Pass the parameters and obtain the run-time details
library(Rperform)
time_commit(t_path, t_commit)

## End(Not run)


analyticalmonk/Rperform documentation built on July 3, 2022, 2:36 a.m.