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
44 changes: 36 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,29 @@ jobs:
if: runner.os == 'Linux'
run: mvn test -P testcontainers

# The full IT suite is split ("sharded") into three disjoint slices selected by JUnit 5 tags, so
# the wall-clock time of a run is the slowest shard (~50 min) instead of the whole suite (~2h+):
# api - every HTTP-level IT (untagged, i.e. everything not tagged "ui")
# ui - the browser-driven ITs except the sample-project and camel families
# samples - the sample-project clone/publish ITs ("sample") + the camel route ITs ("camel")
# The shards partition the suite: api + ui + samples = the complete IT set. A new untagged IT
# lands in "api"; a new UI IT (extends UserInterfaceIntegrationTest) lands in "ui" unless it is
# explicitly tagged "sample" or "camel".
integration-tests-h2:
runs-on: ubuntu-latest
# A green full IT run takes ~1h30m; a heap-exhausted JVM used to thrash for 4h+ before anyone
strategy:
fail-fast: false
matrix:
shard:
- name: api
groups: "!ui"
- name: ui
groups: "ui & !sample & !camel"
- name: samples
groups: "sample | camel"
# A green shard takes ~50 min; a heap-exhausted JVM used to thrash for 4h+ before anyone
# noticed. Cap the job well above the healthy time so hangs fail fast instead of burning runners.
timeout-minutes: 150
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -201,14 +219,14 @@ jobs:
run: ttyd --version

- name: Integration tests
run: mvn clean install -P integration-tests
run: mvn clean install -P integration-tests -Dit.groups='${{ matrix.shard.groups }}'

- name: Generate a random artifact name
if: always()
id: generate_name
run: |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
echo "ARTIFACT_NAME=selenide-screenshots-${TIMESTAMP}.zip" >> $GITHUB_ENV
echo "ARTIFACT_NAME=selenide-screenshots-h2-${{ matrix.shard.name }}-${TIMESTAMP}.zip" >> $GITHUB_ENV

- name: Upload selenide screenshots
uses: actions/upload-artifact@v4
Expand All @@ -220,8 +238,18 @@ jobs:

integration-tests-postgresql:
runs-on: ubuntu-latest
# Same rationale as integration-tests-h2: green run ~1h30m, cap runaway JVMs.
timeout-minutes: 150
# Same sharding + timeout rationale as integration-tests-h2.
strategy:
fail-fast: false
matrix:
shard:
- name: api
groups: "!ui"
- name: ui
groups: "ui & !sample & !camel"
- name: samples
groups: "sample | camel"
timeout-minutes: 90
env:
POSTGRES_DB: testdb
POSTGRES_USER: testuser
Expand Down Expand Up @@ -276,7 +304,7 @@ jobs:
run: ttyd --version

- name: Integration tests
run: mvn clean install -P integration-tests
run: mvn clean install -P integration-tests -Dit.groups='${{ matrix.shard.groups }}'
env:
DIRIGIBLE_DATASOURCE_DEFAULT_DRIVER: org.postgresql.Driver
DIRIGIBLE_DATASOURCE_DEFAULT_URL: jdbc:postgresql://localhost:5432/${{ env.POSTGRES_DB }}
Expand All @@ -288,7 +316,7 @@ jobs:
id: generate_name
run: |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
echo "ARTIFACT_NAME=selenide-screenshots-${TIMESTAMP}.zip" >> $GITHUB_ENV
echo "ARTIFACT_NAME=selenide-screenshots-postgresql-${{ matrix.shard.name }}-${TIMESTAMP}.zip" >> $GITHUB_ENV

- name: Upload selenide screenshots
uses: actions/upload-artifact@v4
Expand Down
38 changes: 31 additions & 7 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Nightly Integration Tests

# The full Selenide UI integration suite (everything, incl. the sample-project clone/publish tests)
# on both H2 and PostgreSQL. It is heavy (~1.5h per DB), so it does not run on every PR - PRs run the
# fast "smoke-tests" job (see pull-request.yml). Runs on a nightly schedule and on demand; the same
# full suite also runs on every push to master (see build.yml).
# on both H2 and PostgreSQL. It is heavy (~2h of test time per DB), so it does not run on every PR -
# PRs run the fast "smoke-tests" job (see pull-request.yml). Runs on a nightly schedule and on
# demand; the same full suite also runs on every push to master (see build.yml). Like build.yml, the
# suite is sharded into three tag-selected slices (api / ui / samples) that run in parallel, so the
# wall-clock time is the slowest shard (~50 min), not the whole suite.
on:
schedule:
- cron: '0 2 * * *'
Expand All @@ -16,6 +18,17 @@ concurrency:
jobs:
integration-tests-h2:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard:
- name: api
groups: "!ui"
- name: ui
groups: "ui & !sample & !camel"
- name: samples
groups: "sample | camel"
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -52,14 +65,14 @@ jobs:
run: ttyd --version

- name: Integration tests
run: mvn clean install -P integration-tests
run: mvn clean install -P integration-tests -Dit.groups='${{ matrix.shard.groups }}'

- name: Generate a random artifact name
if: always()
id: generate_name
run: |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
echo "ARTIFACT_NAME=selenide-screenshots-h2-${TIMESTAMP}.zip" >> $GITHUB_ENV
echo "ARTIFACT_NAME=selenide-screenshots-h2-${{ matrix.shard.name }}-${TIMESTAMP}.zip" >> $GITHUB_ENV

- name: Upload selenide screenshots
uses: actions/upload-artifact@v4
Expand All @@ -71,6 +84,17 @@ jobs:

integration-tests-postgresql:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard:
- name: api
groups: "!ui"
- name: ui
groups: "ui & !sample & !camel"
- name: samples
groups: "sample | camel"
timeout-minutes: 90
env:
POSTGRES_DB: testdb
POSTGRES_USER: testuser
Expand Down Expand Up @@ -125,7 +149,7 @@ jobs:
run: ttyd --version

- name: Integration tests
run: mvn clean install -P integration-tests
run: mvn clean install -P integration-tests -Dit.groups='${{ matrix.shard.groups }}'
env:
DIRIGIBLE_DATASOURCE_DEFAULT_DRIVER: org.postgresql.Driver
DIRIGIBLE_DATASOURCE_DEFAULT_URL: jdbc:postgresql://localhost:5432/${{ env.POSTGRES_DB }}
Expand All @@ -137,7 +161,7 @@ jobs:
id: generate_name
run: |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
echo "ARTIFACT_NAME=selenide-screenshots-postgresql-${TIMESTAMP}.zip" >> $GITHUB_ENV
echo "ARTIFACT_NAME=selenide-screenshots-postgresql-${{ matrix.shard.name }}-${TIMESTAMP}.zip" >> $GITHUB_ENV

- name: Upload selenide screenshots
uses: actions/upload-artifact@v4
Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Treat `modules/commons/commons-config/src/main/java/org/eclipse/dirigible/common

- `code-style`: `mvn -T 1C formatter:validate`
- `tests` (ubuntu + windows matrix): `mvn clean install -P unit-tests`
- `integration-tests-h2` / `-postgresql`: the **full** Selenide IT suite, `mvn clean install -P integration-tests` with the matching `DIRIGIBLE_DATASOURCE_DEFAULT_*` env vars (MSSQL is no longer a CI leg — removed in #6150)
- `integration-tests-h2` / `-postgresql`: the **full** Selenide IT suite, `mvn clean install -P integration-tests` with the matching `DIRIGIBLE_DATASOURCE_DEFAULT_*` env vars (MSSQL is no longer a CI leg — removed in #6150). Each DB leg is **sharded into three parallel matrix jobs** selected by tag expression — `api` (`!ui`), `ui` (`ui & !sample & !camel`), `samples` (`sample | camel`) — so the run's wall clock is the slowest shard (~50 min), not the whole ~2h suite. The shards partition the suite; keep them disjoint and complete when adding tags.
- `build-deploy`: `mvn clean install -P quick-build` then Docker buildx multi-arch image push to `dirigiblelabs/dirigible`

### PR gate vs full suite (smoke / nightly split)
Expand All @@ -451,5 +451,6 @@ The full Selenide UI suite takes ~1.5h per DB, so it does **not** run on every P
- Every browser-driven IT is `@Tag("ui")` - inherited from the `UserInterfaceIntegrationTest` base (and thus by `SampleProjectRepositoryIT` and all sample-project ITs). Do not tag these individually.
- HTTP-level ITs (`extends IntegrationTest` directly) carry no tag, so they are always in the smoke set.
- To force a specific UI IT to run on every PR, add `@Tag("smoke")` to that class (keep the list small - smoke must stay fast).
- Shard-routing tags: `@Tag("sample")` sits on the `SampleProjectRepositoryIT` base (inherited by every sample-project IT); `@Tag("camel")` sits on each IT in `ui/tests/camel` (their `PredefinedProjectIT` base is shared with non-camel tests, so the base cannot carry it — tag new camel ITs individually). These route classes into the `samples` CI shard; everything else UI stays in the `ui` shard.

`codeql.yml`, `release.yml` cover CodeQL and Maven Central release respectively.
4 changes: 3 additions & 1 deletion tests/tests-integrations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@
<artifactId>maven-failsafe-plugin</artifactId>
<!-- JUnit 5 tag selection lives here (not in the root pom) so only this module -
which has the JUnit 5 engine and the tagged ITs - applies it. Empty by default
(full run); the PR smoke job passes -Dit.groups="!ui | smoke". Putting it in the
(full run); the PR smoke job passes -Dit.groups="!ui | smoke", and the master/
nightly IT jobs shard the suite via -Dit.groups="!ui" / "ui & !sample & !camel" /
"sample | camel" (see .github/workflows/build.yml). Putting it in the
root failsafe config breaks other modules (e.g. dirigible-cli) that run failsafe
without a JUnit 5 engine, since non-empty groups require one on the classpath. -->
<configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import org.eclipse.dirigible.tests.base.PredefinedProjectIT;
import org.eclipse.dirigible.tests.base.TestProject;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Autowired;

@Tag("camel")
public class CamelAsyncStepIT extends PredefinedProjectIT {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
import org.eclipse.dirigible.tests.framework.logging.LogsAsserter;
import org.eclipse.dirigible.tests.framework.util.SynchronizationUtil;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import java.util.concurrent.TimeUnit;

import static org.awaitility.Awaitility.await;

@Tag("camel")
public class CamelCronRouteStarterTemplateIT extends UserInterfaceIntegrationTest {

private static final String TEMPLATE_TITLE = "Cron Route Project Starter";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import org.eclipse.dirigible.tests.base.PredefinedProjectIT;
import org.eclipse.dirigible.tests.base.TestProject;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Autowired;

@Tag("camel")
public class CamelDirigibleJavaScriptComponentCronRouteIT extends PredefinedProjectIT {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import org.eclipse.dirigible.tests.base.PredefinedProjectIT;
import org.eclipse.dirigible.tests.base.TestProject;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Autowired;

@Tag("camel")
public class CamelDirigibleJavaScriptComponentHttpRouteIT extends PredefinedProjectIT {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import org.eclipse.dirigible.tests.base.PredefinedProjectIT;
import org.eclipse.dirigible.tests.base.TestProject;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Autowired;

@Tag("camel")
public class CamelDirigibleTwoStepsJSInvokerCronRouteIT extends PredefinedProjectIT {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import org.eclipse.dirigible.tests.base.PredefinedProjectIT;
import org.eclipse.dirigible.tests.base.TestProject;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Autowired;

@Tag("camel")
public class CamelDirigibleTwoStepsJSInvokerHttpRouteIT extends PredefinedProjectIT {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import org.eclipse.dirigible.tests.base.PredefinedProjectIT;
import org.eclipse.dirigible.tests.base.TestProject;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Autowired;

@Tag("camel")
public class CamelExtractTransformLoadJdbcIT extends PredefinedProjectIT {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import org.eclipse.dirigible.tests.base.PredefinedProjectIT;
import org.eclipse.dirigible.tests.base.TestProject;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Autowired;

@Tag("camel")
public class CamelExtractTransformLoadTypescriptIT extends PredefinedProjectIT {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
import org.eclipse.dirigible.tests.framework.ide.Workbench;
import org.eclipse.dirigible.tests.framework.restassured.RestAssuredExecutor;
import org.eclipse.dirigible.tests.framework.util.SynchronizationUtil;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.containsString;

@Tag("camel")
public class CamelHttpRouteStarterTemplateIT extends UserInterfaceIntegrationTest {

private static final String TEMPLATE_TITLE = "HTTP Route Project Starter";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import org.eclipse.dirigible.tests.base.PredefinedProjectIT;
import org.eclipse.dirigible.tests.base.TestProject;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Autowired;

@Tag("camel")
public class CamelTransactionsCommitIT extends PredefinedProjectIT {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
import org.eclipse.dirigible.tests.base.PredefinedProjectIT;
import org.eclipse.dirigible.tests.base.TestProject;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.springframework.beans.factory.annotation.Autowired;

@Disabled("Disabled until transaction logic is implemented")
@Tag("camel")
public class CamelTransactionsRollbackIT extends PredefinedProjectIT {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
import org.eclipse.dirigible.tests.framework.ide.Workbench;
import org.eclipse.dirigible.tests.framework.restassured.RestAssuredExecutor;
import org.eclipse.dirigible.tests.framework.util.SynchronizationUtil;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

// "sample" (on top of the inherited "ui") routes the whole sample-project family into its own CI
// shard - see the integration-tests matrix in .github/workflows/build.yml.
@Tag("sample")
abstract class SampleProjectRepositoryIT extends UserInterfaceIntegrationTest {

@Autowired
Expand Down
Loading