Skip to content

Extract Artifacts Root path out of Artifacts path #822

Closed

Description

@YevgeniyShunevych

Before the v3, Artifacts path was an absolute path to AtataContext artifacts.
Now Artifacts path is split into 2 parts, basically it becomes a path relative to Artifacts Root.

Default Artifacts Root path is "{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}".
Default Artifacts path is "{test-suite-name-sanitized:/*}{test-name-sanitized:/*}".

ArtifactsRoot properties and methods are located in AtataContext.GlobalProperties:

/// <summary>
/// Gets or sets the Artifacts Root path template.
/// The default value is <c>"{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}"</c>.
/// </summary>
public string ArtifactsRootPathTemplate { get; set; }

/// <summary>
/// Gets the <see cref="DirectorySubject"/> of Artifacts Root directory.
/// <see cref="ArtifactsRootPathTemplate"/> property is used to configure the Artifacts Root path.
/// </summary>
public DirectorySubject ArtifactsRoot { get; }

/// <summary>
/// Gets the path of Artifacts Root directory.
/// <see cref="ArtifactsRootPathTemplate"/> property is used to configure the Artifacts Root path.
/// </summary>
public string ArtifactsRootPath { get; }

/// <summary>
/// <para>
/// Sets the path template of the Artifacts Root directory.
/// The default value is <c>"{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}"</c>.
/// </para>
/// <para>
/// The list of supported variables:
/// </para>
/// <list type="bullet">
/// <item><c>{basedir}</c></item>
/// <item><c>{build-start}</c></item>
/// <item><c>{build-start-utc}</c></item>
/// </list>
/// </summary>
/// <param name="directoryPathTemplate">The directory path template.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseArtifactsRootPathTemplate(string directoryPathTemplate);

/// <summary>
/// Sets the default Artifacts root path template with optionally
/// including <c>"{build-start:yyyyMMddTHHmmss}"</c> folder in the path.
/// </summary>
/// <param name="include">Whether to include the <c>"{build-start:yyyyMMddTHHmmss}"</c> folder in the path.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseDefaultArtifactsRootPathTemplateIncludingBuildStart(bool include);

Removed AtataContextBuilder Artifacts configuration methods:

public AtataContextBuilder UseArtifactsPath(string directoryPath);

public AtataContextBuilder UseArtifactsPath(Func<AtataContext, string> directoryPathBuilder);

public AtataContextBuilder UseDefaultArtifactsPathIncludingBuildStart(bool include);

New AtataContextBuilder Artifacts configuration method:

public AtataContextBuilder UseArtifactsPathTemplate(string directoryPathTemplate);

Activity

  1. added this to the 3.0.0 milestone on Feb 17, 2024
  2. added a commit that references this issue on Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions