vaadin / vaadin/browserless-test

Improve Quarkus testing by preventing Vaadin servlet registration.

Open
#52 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1
Forks
3
Avg merge
1d 20h
Merged PRs (30d)
51

Description

Browserless testing on Quarkus needs to mark Vaadin the test class with @QuarkusTest annotation so that all the augmentation provided by the Vaadin extension (scopes, beans, unremovables, ...) is available during test execution.

The drawback is that with @QuarkusTest, the application is started, including the servlet container and the Vaadin initialization.
With browserless testing, both are unnecessary and only slow down the execution of the tests.

After vaadin/quarkus#281 is implemented, the Quarkus browserless testing module should provide a test profile (BrowserlessTestProfile) named vaadin-browserless and a @BrowserlessQuarkusTest annotation which activates @QuarkusTest and the test profile`

@Retention(RetentionPolicy.RUNTIME)  
@Target(ElementType.TYPE)
@QuarkusTest
@TestProfile(BrowserlessTestProfile.class)
public @interface BrowserlessQuarkusTest {}

The BrowserlessTestProfile class itself should also prevent the HTTP server from being bound to any port

public class VaadinFastTestProfile implements QuarkusTestProfile {
    @Override
    public String getConfigProfile() { return "vaadin-browserless"; }
    @Override
    public Map<String, String> getConfigOverrides() {
        return Map.of("quarkus.http.host-enabled", "false");
    }
}

User tests should then use @BrowserlessQuarkusTest instead of @QuarkusTest.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Quarkus browserless testing module and the existing user tests, then check the prerequisite vaadin/quarkus#281 behavior. Add the requested BrowserlessTestProfile and @BrowserlessQuarkusTest integration, and verify that browserless tests use the annotation without binding the HTTP server or starting the servlet container.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.