Skip to content
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
32 changes: 28 additions & 4 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,18 @@ jobs:
ARGS="-pl ${{matrix.module}} -Dtest=${{matrix.args}}" || \
ARGS="-pl ${{matrix.args}}"
cmd="mvn -B -ntp -T 1C $ARGS"
set -x -e -o pipefail
$cmd verify -Dmaven.javadoc.skip=false | tee mvn-unit-tests-${{matrix.current}}.out
set -x -e
LOG=mvn-unit-tests-${{matrix.current}}.out
$cmd verify -Dmaven.javadoc.skip=false </dev/null >"$LOG" 2>&1 &
MVN_PID=$!
tail -f --pid=$MVN_PID "$LOG" &
wait $MVN_PID
- name: Kill leftover Java processes
if: ${{ always() }}
run: |
pkill -TERM java || true
sleep 2
pkill -KILL java || true
- name: Package test-report files
if: ${{ failure() || success() }}
run: find . -name surefire-reports -o -name failsafe-reports -o -name error-screenshots -o -name "mvn-*.out" | tar -czf tests-report-unit-${{matrix.current}}.tgz -T -
Expand Down Expand Up @@ -209,13 +219,27 @@ jobs:
$cmd -T 1C || $cmd
fi
- name: Run ITs
timeout-minutes: 22
run: |
[ -n "${{matrix.module}}" ] && \
ARGS="-Dfailsafe.forkCount=4 -pl ${{matrix.module}} -Dit.test=${{matrix.args}}" || \
ARGS="-pl ${{matrix.args}}"
cmd="mvn -V -B -ntp -e -fae -Dcom.vaadin.testbench.Parameters.testsInParallel=5 -Dfailsafe.rerunFailingTestsCount=2 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Pbun $ARGS"
set -x -e -o pipefail
$cmd verify | tee -a mvn-it-tests-${{matrix.current}}.out
set -x -e
LOG=mvn-it-tests-${{matrix.current}}.out
# Detach mvn's stdio from this shell so an orphan child JVM (e.g. a
# Spring Boot fork that spring-boot:stop failed to kill) can't pin
# the step open by holding the pipe to tee.
$cmd verify </dev/null >"$LOG" 2>&1 &
MVN_PID=$!
tail -f --pid=$MVN_PID "$LOG" &
wait $MVN_PID
- name: Kill leftover Java processes
if: ${{ always() }}
run: |
pkill -TERM java || true
sleep 2
pkill -KILL java || true
- name: Package test-report files
if: ${{ always() }}
run: find . -name surefire-reports -o -name failsafe-reports -o -name error-screenshots -o -name "mvn-*.out" -o -name "jetty-start.out" | tar -czf tests-report-it-${{matrix.current}}.tgz -T -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,13 @@ public List<String> getPnpmExecutable() {
List<String> pnpmCommand = getSuitablePnpm();
assert !pnpmCommand.isEmpty();
pnpmCommand = new ArrayList<>(pnpmCommand);
pnpmCommand.add("--shamefully-hoist=true");
// Force hoisted (flat npm-style) layout. CLI takes precedence over
// .npmrc, so this is unambiguous even if the project lacks the
// generated .npmrc. Replaces the previous --shamefully-hoist=true,
// which only controls the partial-hoist heuristic on top of the
// default isolated layout and did not consistently expose every
// transitive at the project root.
pnpmCommand.add("--config.node-linker=hoisted");
return pnpmCommand;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,9 @@ void knownFaultyNpmVersionThrowsException() {
@Test
void getPnpmExecutable_executableIsAvailable() {
List<String> executable = tools.getPnpmExecutable();
// command line should contain --shamefully-hoist=true option
assertTrue(executable.contains("--shamefully-hoist=true"));
// command line should force hoisted node-linker so transitive
// deps are always installed at the project root
assertTrue(executable.contains("--config.node-linker=hoisted"));
assertTrue(executable.stream().anyMatch(cmd -> cmd.contains("pnpm")));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ void getDefaultDevDependencies_includesAllDependencies_whenUsingVite() {
expectedDependencies.add("transform-ast");
expectedDependencies.add("strip-css-comments");
expectedDependencies.add("@babel/preset-react");
expectedDependencies.add("@babel/types");
expectedDependencies.add("@types/react");
expectedDependencies.add("@types/react-dom");
expectedDependencies.add("@preact/signals-react-transform");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ void runPnpmInstall_npmRcFileNotFound_newNpmRcFileIsGenerated()
String content = FileUtils.readFileToString(npmRcFile,
StandardCharsets.UTF_8);
assertTrue(content.contains("shamefully-hoist"));
assertTrue(content.contains("node-linker=hoisted"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@rollup/plugin-replace": "6.0.3",
"@rollup/pluginutils": "5.3.0",
"@babel/preset-react": "7.28.5",
"@babel/types": "7.28.5",
"rollup-plugin-visualizer": "7.0.1",
"rollup-plugin-brotli": "3.1.0",
"vite-plugin-checker": "0.12.0",
Expand Down
6 changes: 6 additions & 0 deletions flow-server/src/main/resources/npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
#
# This file sets the default parameters for manual `pnpm install`.
#
# node-linker=hoisted produces a flat node_modules layout (like npm),
# so every transitive dependency lives at the project root. Flow's
# frontend tooling and bundled Vite plugins (e.g. the React function
# location plugin) import transitive deps that pnpm's symlink-based
# layout did not consistently hoist, even with shamefully-hoist=true.
node-linker=hoisted
shamefully-hoist=true
strict-peer-dependencies=false
23 changes: 23 additions & 0 deletions flow-tests/test-redeployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,29 @@

<build>
<plugins>
<!-- Run BEFORE spring-boot-maven-plugin so the sleep below executes
ahead of stop-server in the post-integration-test phase. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>quiet-period-before-stop</id>
<goals>
<goal>run</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<!-- Tests in this module trigger DevTools restarts; give the
admin JMX bean time to be re-registered after the last
restart so spring-boot:stop can find it. -->
<target>
<sleep seconds="5"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand Down
Loading