Skip to content

Functional Tests - All Databases #2782

Functional Tests - All Databases

Functional Tests - All Databases #2782

name: Functional Tests - All Databases
on:
# Manual trigger.
workflow_dispatch:
pull_request_review:
types: [submitted]
# Run it on main and release pushes too, in case we merge from a branch that's not up-to-date with the target branch
# and breaks something after merge (or if we push to main).
push:
paths-ignore:
- '**/*.md'
- 'mkdocs.yml'
- 'src/docs/**/*'
branches: [ main, release/** ]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
test_functional_mvc:
name: Functional Tests - MVC
# These conditions are needed because the workflow triggers on individual PR comments too, see
# https://github.com/orgs/community/discussions/124396.
# They either need to be repeated for each job, or we need to use a separate job (i.e. VM to run the condition) that
# triggers the others.
if: github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-latest
container:
image: cypress/included:9.6.1
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- uses: actions/setup-node@v4
with:
node-version: "15"
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
npm install
npm run mvc:test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: functional-mvc-screenshots
path: test/OrchardCore.Tests.Functional/mvc-tests/cypress/screenshots
retention-days: 3
test_functional_cms_sqlite:
name: Functional Tests - CMS Sqlite
if: github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-latest
container:
image: cypress/included:9.6.1
env:
OrchardCore__OrchardCore_YesSql__EnableThreadSafetyChecks: true
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
npm install
npm run cms:test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: functional-cms-sqlite-failure
path: |
test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots
src/OrchardCore.Cms.Web/App_Data/logs
retention-days: 3
test_functional_cms_postgresql:
name: Functional Tests - CMS Postgres
if: github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-latest
container:
image: cypress/included:9.6.1
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
POSTGRES_DB: app
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
OrchardCore__ConnectionString: "User ID=postgres;Password=admin;Host=postgres;Port=5432;Database=app;"
OrchardCore__DatabaseProvider: "Postgres"
OrchardCore__OrchardCore_YesSql__EnableThreadSafetyChecks: true
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
npm install
npm run cms:test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: functional-cms-postgresql-failure
path: |
test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots
src/OrchardCore.Cms.Web/App_Data/logs
retention-days: 3
test_functional_cms_mysql:
name: Functional Tests - CMS MySql
if: github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-latest
container:
image: cypress/included:9.6.1
services:
mysql:
image: mysql:8
ports:
- 3306
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: test123
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
OrchardCore__ConnectionString: "server=mysql;uid=root;pwd=test123;database=test"
OrchardCore__DatabaseProvider: "MySql"
OrchardCore__OrchardCore_YesSql__EnableThreadSafetyChecks: true
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
npm install
npm run cms:test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: functional-cms-mysql-failure
path: |
test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots
src/OrchardCore.Cms.Web/App_Data/logs
retention-days: 3
test_functional_cms_mssql:
name: Functional Tests - CMS SqlServer 2019
if: github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
github.event.review.state == 'APPROVED' ||
github.event.review.state == 'CHANGES_REQUESTED'
runs-on: ubuntu-latest
container:
image: cypress/included:9.6.1
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- 1433
env:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: Password12!
env:
OrchardCore__ConnectionString: "Server=mssql;Database=tempdb;User Id=sa;Password=Password12!;Encrypt=False"
OrchardCore__DatabaseProvider: "SqlConnection"
OrchardCore__OrchardCore_YesSql__EnableThreadSafetyChecks: true
steps:
- uses: actions/checkout@v4
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
npm install
npm run cms:test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: functional-cms-mssql-failure
path: |
test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots
src/OrchardCore.Cms.Web/App_Data/logs
retention-days: 3