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

Support of YAML configuration #240

Open
Sgitario opened this issue Sep 7, 2021 · 0 comments
Open

Support of YAML configuration #240

Sgitario opened this issue Sep 7, 2021 · 0 comments
Labels
enhancement New feature or request priority/low lowest priority

Comments

@Sgitario
Copy link
Contributor

Sgitario commented Sep 7, 2021

At the moment, the quarkus test framework is highly tied to properties file in the form of:

a.b=value

However, when using a YAML properties file for Quarkus, it might have some side effects (mostly when the test framework triggers a build operator to create the Quarkus applications at each scenario)

Sgitario added a commit to Sgitario/quarkus-test-framework that referenced this issue Sep 28, 2021
By default, the test framework will use the `application.properties` file at `src/main/resources` folder. The service interface provides multiple methods to add properties at test scope only:
- `service.withProperties(path)`
- `service.withProperty(key, value)`

If you want to use a different application properties file for all the tests, you can add the `application.properties` file at `src/test/resources` and the test framework will use this instead.

Moreover, if you want to select a concrete application properties file for a single test scenario, then you can configure your Quarkus application using:

```java
@QuarkusScenario
public class PingPongResourceIT {

    @QuarkusApplication(properties = "my-custom-properties.properties")
    static final RestService pingpong = new RestService();
}
```

This option is available also for Dev Mode, Remote Dev mode and remote git applications, and works for JVM, Native, OpenShift and Kubernetes. 

| Note that the test framework does not support the usage of YAML files yet [quarkus-qe#240](quarkus-qe#240)
Sgitario added a commit to Sgitario/quarkus-test-framework that referenced this issue Sep 28, 2021
By default, the test framework will use the `application.properties` file at `src/main/resources` folder. The service interface provides multiple methods to add properties at test scope only:
- `service.withProperties(path)`
- `service.withProperty(key, value)`

If you want to use a different application properties file for all the tests, you can add the `application.properties` file at `src/test/resources` and the test framework will use this instead.

Moreover, if you want to select a concrete application properties file for a single test scenario, then you can configure your Quarkus application using:

```java
@QuarkusScenario
public class PingPongResourceIT {

    @QuarkusApplication(properties = "my-custom-properties.properties")
    static final RestService pingpong = new RestService();
}
```

This option is available also for Dev Mode, Remote Dev mode and remote git applications, and works for JVM, Native, OpenShift and Kubernetes. 

| Note that the test framework does not support the usage of YAML files yet [quarkus-qe#240](quarkus-qe#240)
@pjgg pjgg added enhancement New feature or request priority/low lowest priority labels Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority/low lowest priority
Projects
None yet
Development

No branches or pull requests

2 participants