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

test: Run tests using React 19 + 18 #2962

Merged
merged 7 commits into from
Feb 28, 2025
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
69 changes: 62 additions & 7 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ jobs:
name: Check style
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false

steps:
- name: Checkout Project Code
Expand Down Expand Up @@ -120,8 +118,6 @@ jobs:
name: Test Java
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false

steps:
- name: Checkout Project Code
Expand Down Expand Up @@ -160,8 +156,6 @@ jobs:
name: Test TypeScript
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false

steps:
- name: Install Chrome
Expand Down Expand Up @@ -311,6 +305,66 @@ jobs:
packages/java/gradle-plugin/build/test-results/*
packages/java/gradle-plugin/build/reports/*

test-react-18:
Copy link
Contributor

Choose a reason for hiding this comment

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

The manual run to verify this change: https://github.com/vaadin/hilla/actions/runs/13588075190

needs:
- init
name: React 18 Tests
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Install Chrome
id: setup-chrome
uses: browser-actions/setup-chrome@v1
- name: Checkout Project Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- uses: actions/download-artifact@v4
with:
name: saved-workspace
- name: Restore Workspace
run: |
set -x
tar xf workspace.tar
tar cf - .m2 | (cd ~ && tar xf -)
- name: Install React 18
run: npm install --save-dev react@18 react-dom@18 @types/react@18 @types/react-dom@18
- name: Test
run: npm run test:react
env:
CI: true
CHROME_BIN: ${{ steps.setup-chrome.outputs.chrome-path }}
- name: Set TB License
run: |
TB_LICENSE=${{secrets.TB_LICENSE}}
mkdir -p ~/.vaadin/
echo '{"username":"'`echo $TB_LICENSE | cut -d / -f1`'","proKey":"'`echo $TB_LICENSE | cut -d / -f2`'"}' > ~/.vaadin/proKey
- name: Verify
run: |
(
cd packages/java/tests && \
mvn -B -am -ntp -fae \
-Dfailsafe.forkCount=4 \
-Dcom.vaadin.testbench.Parameters.testsInParallel=5 \
-Dfailsafe.rerunFailingTestsCount=2 \
-Dmaven.wagon.httpconnectionManager.ttlSeconds=25 \
-Dmaven.wagon.http.retryHandler.count=3 \
-P\!it-modules \
-Preact-18 \
-Pproduction \
verify
)
- uses: actions/upload-artifact@v4
if: ${{ failure() || success() }}
with:
name: saved-outputs-it-${{ matrix.os }}-${{ matrix.it-modules }}
path: |
packages/java/tests/**/target/*-reports/*
packages/java/tests/**/error-screenshots/*.png

test-all:
name: Tests Summary
runs-on: ubuntu-latest
Expand All @@ -321,12 +375,13 @@ jobs:
- test-typescript
- test-it
- test-gradle
- test-react-18
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: saved-outputs
pattern: saved-outputs-*
- name: Fail if test jobs did not succeed
if: ${{ needs.check-style.result != 'success' || needs.test-java.result != 'success' || needs.test-typescript.result != 'success' || needs.test-it.result != 'success' || needs.test-gradle.result != 'success' }}
if: ${{ needs.check-style.result != 'success' || needs.test-java.result != 'success' || needs.test-typescript.result != 'success' || needs.test-it.result != 'success' || needs.test-gradle.result != 'success' || needs.test-react-18.result != 'success' }}
run: exit 1
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lint:fix": "nx run-many -t lint:fix --all --output-style stream",
"test": "nx run-many -t test --all --output-style stream",
"test:coverage": "nx run-many -t test:coverage --all --output-style stream",
"test:react": "nx run-many -t test:react --all --output-style stream",
"typecheck": "nx run-many -t typecheck --all --output-style stream"
},
"repository": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# React 19 (default in Vaadin 25)
com.vaadin.experimental.react19=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# React 19 (default in Vaadin 25)
com.vaadin.experimental.react19=true
55 changes: 45 additions & 10 deletions packages/java/tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<!-- make sure we do not leave webpack-dev-server running after IT -->
<vaadin.reuseDevServer>false</vaadin.reuseDevServer>

<!-- enable React 19 feature flag by default -->
<vaadin.experimental.react19>true</vaadin.experimental.react19>

<!-- Used in the tests, should be overridden for each module to support
concurrent running of test modules. -->
<server.port>8888</server.port>
Expand Down Expand Up @@ -139,6 +142,18 @@

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>${properties-maven-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>set-system-properties</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
Expand Down Expand Up @@ -252,16 +267,26 @@
</goals>
<configuration>
<properties>
<vaadin.reuseDevServer>${vaadin.reuseDevServer}</vaadin.reuseDevServer>
<vaadin.devmode.liveReload.enabled>
${vaadin.devmode.liveReload.enabled}</vaadin.devmode.liveReload.enabled>
<vaadin.allow.appshell.annotations>
${vaadin.allow.appshell.annotations}</vaadin.allow.appshell.annotations>

<jetty.scantrigger>
${jetty.scantrigger}</jetty.scantrigger>--> <!-- Allow test clients not on localhost to connect to Vite-->
<vaadin.devmode.vite.options>
${vaadin.devmode.vite.options}</vaadin.devmode.vite.options>
<jetty.scantrigger>
${jetty.scantrigger}
</jetty.scantrigger>
<vaadin.reuseDevServer>
${vaadin.reuseDevServer}
</vaadin.reuseDevServer>
<vaadin.devmode.liveReload.enabled>
${vaadin.devmode.liveReload.enabled}
</vaadin.devmode.liveReload.enabled>
<vaadin.allow.appshell.annotations>
${vaadin.allow.appshell.annotations}
</vaadin.allow.appshell.annotations>
<!-- Allow test clients not on localhost
to connect to Vite -->
<vaadin.devmode.vite.options>
${vaadin.devmode.vite.options}
</vaadin.devmode.vite.options>
<vaadin.experimental.react19>
${vaadin.experimental.react19}
</vaadin.experimental.react19>
</properties>
</configuration>
</execution>
Expand Down Expand Up @@ -331,5 +356,15 @@
</modules>
</profile>

<profile>
<id>react-18</id>
<properties>
<vaadin.experimental.react19>false</vaadin.experimental.react19>
</properties>
<modules>
<module>spring</module>
</modules>
</profile>

</profiles>
</project>
48 changes: 48 additions & 0 deletions packages/java/tests/spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,44 @@
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<vaadin.reuseDevServer>
${vaadin.reuseDevServer}
</vaadin.reuseDevServer>
<vaadin.devmode.liveReload.enabled>
${vaadin.devmode.liveReload.enabled}
</vaadin.devmode.liveReload.enabled>
<vaadin.allow.appshell.annotations>
${vaadin.allow.appshell.annotations}
</vaadin.allow.appshell.annotations>
<!-- Allow test clients not on localhost
to connect to Vite -->
<vaadin.devmode.vite.options>
${vaadin.devmode.vite.options}
</vaadin.devmode.vite.options>
<vaadin.experimental.react19>
${vaadin.experimental.react19}
</vaadin.experimental.react19>
<vaadin.reuseDevServer>
${vaadin.reuseDevServer}
</vaadin.reuseDevServer>
<vaadin.devmode.liveReload.enabled>
${vaadin.devmode.liveReload.enabled}
</vaadin.devmode.liveReload.enabled>
<vaadin.allow.appshell.annotations>
${vaadin.allow.appshell.annotations}
</vaadin.allow.appshell.annotations>
<!-- Allow test clients not on localhost
to connect to Vite-->
<vaadin.devmode.vite.options>
${vaadin.devmode.vite.options}
</vaadin.devmode.vite.options>
<vaadin.experimental.react19>
${vaadin.experimental.react19}
</vaadin.experimental.react19>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Expand Down Expand Up @@ -231,6 +269,16 @@
</modules>
</profile>

<profile>
<id>react-18</id>
<modules>
<module>no-endpoints</module>
<module>react-grid-test</module>
<module>react-i18n</module>
<module>react-signals</module>
</modules>
</profile>

<profile>
<id>native</id>
<modules>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Enable Hilla I18n feature flag so that we can test it
com.vaadin.experimental.hillaI18n=true
# React 19 (default in Vaadin 25)
com.vaadin.experimental.react19=true
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Enable Hilla I18n feature flag so that we can test it
com.vaadin.experimental.hillaI18n=true
# React 19 (default in Vaadin 25)
com.vaadin.experimental.react19=true
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Experimental feature flags for Vaadin
com.vaadin.experimental.fullstackSignals=true
# React 19 (default in Vaadin 25)
com.vaadin.experimental.react19=true
1 change: 1 addition & 0 deletions packages/ts/file-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"lint:fix": "eslint src test --fix",
"test": "vitest --run",
"test:coverage": "vitest --run --coverage",
"test:react": "npm run test",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/ts/generator-plugin-transfertypes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
"lint": "eslint src test",
"lint:fix": "eslint src test --fix",
"test": "vitest --run",
"test:update": "vitest --update",
"test:coverage": "vitest --coverage",
"test:coverage": "vitest --run --coverage",
"test:update": "vitest --run --update",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
"exports": {
Expand Down
1 change: 1 addition & 0 deletions packages/ts/react-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lint:fix": "eslint src test --fix",
"test": "vitest --run",
"test:coverage": "vitest --run --coverage",
"test:react": "npm run test",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
Expand Down
1 change: 1 addition & 0 deletions packages/ts/react-crud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lint:fix": "eslint src test --fix",
"test": "vitest --run",
"test:coverage": "vitest --run --coverage",
"test:react": "npm run test",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
Expand Down
1 change: 1 addition & 0 deletions packages/ts/react-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lint:fix": "eslint src test --fix",
"test": "vitest --run",
"test:coverage": "vitest --run --coverage",
"test:react": "npm run test",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
Expand Down
1 change: 1 addition & 0 deletions packages/ts/react-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lint:fix": "eslint src test --fix",
"test": "vitest --run",
"test:coverage": "vitest --run --coverage",
"test:react": "npm run test",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
Expand Down
1 change: 1 addition & 0 deletions packages/ts/react-signals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lint:fix": "eslint src test --fix",
"test": "vitest --run",
"test:coverage": "vitest --run --coverage",
"test:react": "npm run test",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
Expand Down