Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed infra-tester config file #20

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration

*infra-tester* uses [**YAML**](https://yaml.org/) as its configuration language and supports most of YAML 1.1 and 1.2, including support for anchors, tags, map merging, etc. When *infra-tester* is run, it looks for a `config.yaml` file in the current directory to run the tests.
*infra-tester* uses [**YAML**](https://yaml.org/) as its configuration language and supports most of YAML 1.1 and 1.2, including support for anchors, tags, map merging, etc. When *infra-tester* is run, it looks for a `.infra-tester-config.yaml` file in the current directory to run the tests.

The configuration for *infra-tester* has the following structure:

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/extending_infra_tester.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ This section shows an example package that provides two plugins:
--8<-- "example/plugin-example/pyproject.toml"
```

=== "Usage in config.yaml"
=== "Usage in .infra-tester-config.yaml"

```yaml linenums="42" title="example/config.yaml"
```yaml linenums="42" title="example/.infra-tester-config.yaml"
...
- name: ExamplesCustomAssertions
apply:
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/writing_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ A basic test would be a regular expression matching to make sure the output
adheres to the RFC 3339 format. Let's see how we can write such a test using
*infra-tester*.

Let's create a `config.yaml` file in the same directory where we created the
Let's create a `.infra-tester-config.yaml` file in the same directory where we created the
Terraform file and copy the below code into it. See the annotation next
to the code to understand what it does.

```yaml title="config.yaml" linenums="1"
```yaml title=".infra-tester-config.yaml" linenums="1"
test_plan:
name: Time #(1)
tests: # (2)
Expand Down Expand Up @@ -102,7 +102,7 @@ The above configuration is all that's required to test the use case we mentioned
## Running the Tests

Change the working directory to the same directory where you created the Terraform
file and the `config.yaml` file and run
file and the `.infra-tester-config.yaml` file and run

```shell
infra-tester -test.v
Expand All @@ -129,7 +129,7 @@ Let's modify the regular expression so that it's invalid and see what happens.
To make it invalid let's remove the first two opening brackets, so the
line would then be:

```yaml title="config.yaml" linenums="10"
```yaml title=".infra-tester-config.yaml" linenums="10"
regex: ^?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[\+-]\d{2}:\d{2})?)$

```
Expand All @@ -153,7 +153,7 @@ easy-to-catch issues. This leads to a better developer experience.
Let us now try to pass it a valid regular expression but one that doesn't
adhere to RFC 3339. Let's modify the line to the following:

```yaml title="config.yaml" linenums="10"
```yaml title=".infra-tester-config.yaml" linenums="10"
regex: ^((?:T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[\+-]\d{2}:\d{2})?)$
```

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func runApplyAssertions(
}

func getTests() (TestPlan, error) {
yamlConfig, err := os.ReadFile("config.yaml")
yamlConfig, err := os.ReadFile(".infra-tester-config.yaml")
if err != nil {
return TestPlan{}, fmt.Errorf("failed to read yaml config: %v", err)
}
Expand Down