Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

contributing: doc to run a single test #317

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions _docs/contributing_to_a_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,18 @@ rspec tests define them in fixtures.yml. We use this over `pdk test unit` as it
![pdk_test_unit](pdkunit.png)
![pdk_bundle_exec_rake_spec](rakespec.png)

To run a single test file, you can use the `SPEC=<path>` option
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To run a single test file, you can use the `SPEC=<path>` option
To run a single test file, you can directly reference the spec file that you wish to run.


```shell
% pdk bundle exec rake spec SPEC=<path to rb file>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
% pdk bundle exec rake spec SPEC=<path to rb file>
% pdk bundle exec rake spec <path to rb file>

```

For example

```shell
% pdk bundle exec rake spec SPEC=spec/functions/loadjson_spec.rb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
% pdk bundle exec rake spec SPEC=spec/functions/loadjson_spec.rb
% pdk bundle exec rake spec spec/functions/loadjson_spec.rb

```

### Acceptance Tests

All Puppet Supported modules come with acceptance tests, which use [puppet litmus][puppet-litmus].
Expand Down