plot_webpage: Plot the specified metrics of all test files in a specified...

View source: R/plot_metrics.R

plot_webpageR Documentation

Plot the specified metrics of all test files in a specified directory on a webpage.

Description

It plots specified metrics for all the tests present in the specified directory of the current git repository on a webpage.

Usage

plot_webpage(test_directory = "tests/testthat", metric = "testMetrics",
  output_name = "RperformTest.html")

Arguments

test_directory

Path of the directory containing the test files.

metric

Type of plot(s) desired. This can be set to time, memory, memtime or testMetrics. (See examples below for more details)

output_name

Name of the output .html file.

WARNING

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

Examples


## Not run: 
# Set to the git repository in consideration.
setwd("path/to/repo")
d_path <- "path/to/tests"

# Load the library
library(Rperform)

## Example-1

# Pass the parameters and obtain the run-time followed by memory details against 10 commits
# on two seperate webpages (html files).
plot_webpage(test_directory = d_path, metric = "time", output_name = "timePage")
plot_metrics(test_directory = d_path, metric = "memory", output_name = "memPage")

## Example-2

# Obtain both memory and time metrics for each individual testthat block
# inside a file and the file itself.
plot_webpage(d_path, metric = "testMetrics", output_name = "testMetricsPage")

## End(Not run)


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