gaelcolas / gaelcolas/Sampler

Remove running hqrmtest from task 'test' (and instead run it indvidually)

Open
#389 1 comment 0 reactions 0 assignees View on GitHub
good first issue help wanted tests
Dominant language
PowerShell
Stars
243
Forks
46
Avg merge
1h 41m
Merged PRs (30d)
1

Description

### Problem description

When running the build script to test a specific test the hqrmtest are also run which takes time in the development process.

```
.\build.ps1 -Tasks test -PesterPath .\tests\Unit\Public\Get-BuildVersion.tests.ps1 -CodeCoverageThreshold 1
```

### Verbose logs

```text
Pester v5.3.3

Starting discovery in 1 files.
Discovery found 12 tests in 34ms.
Starting code coverage.
Code Coverage preparation finished after 2165 ms.
Running tests.

Running tests from 'C:\source\Sampler\tests\Unit\Public\Get-BuildVersion.tests.ps1'
Describing Get-BuildVersion
...
===============================================================================
INVOKE HQRM TESTS
Making sure the Module meets some quality standard (help, tests)
-------------------------------------------------------------------------------
...
Done /test/hqrmtest/Invoke_HQRM_Tests_Stop_On_Fail/Fail_Build_If_HQRM_Tests_Failed 00:00:00.0999452
Done /test/hqrmtest/Invoke_HQRM_Tests_Stop_On_Fail 00:00:17.0173025
Done /test/hqrmtest 00:00:17.0180906
Done /test 00:00:29.6944551
```

### How to reproduce

Running this will run the hqrmtest:

```
.\build.ps1 -Tasks test -PesterPath .\tests\Unit\Public\Get-BuildVersion.tests.ps1 -CodeCoverageThreshold 1
```

### Expected behavior

Not to run the task hqrmtest

### Current behavior

Runs the task hqrmtest.

### Suggested solution

Remove this line from the meta build task `test`:

https://github.com/gaelcolas/Sampler/blob/bc25ba558383d3ddba7ded9a2e51233f2bc9d4e7/build.yaml#L139

Add a new job to the Azure Pipeline stage **Test**:

Example: https://github.com/dsccommunity/DscResource.Common/blob/c816a0951588a7d01481613bfab85fa7600aa830/azure-pipelines.yml#L52-L78

Optionally: Create a new informational meta task that can be run for the meta build task `test` that suggests that the user also runs the HQRM tests before PR by running `.\build.ps1 -Tasks hqrmtest`.

### Operating system the target node is running

```text
n/a
```

### PowerShell version and build the target node is running

```text
n/a
```

### Module version used

```text
main branch
```

Contributor guide

Open the contributing guide

Research direction

Inspect build.yaml at the meta build task test, then review the Azure Pipeline Test stage and its existing hqrmtest configuration. Run .\build.ps1 -Tasks test -PesterPath .\tests\Unit\Public\Get-BuildVersion.tests.ps1 -CodeCoverageThreshold 1 to confirm targeted tests no longer invoke HQRM tests, and verify HQRM tests still run individually in the Test stage.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
build-system, ci-cd, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.