diff --git a/.github/actions/ui-tests/action.yml b/.github/actions/ui-tests/action.yml new file mode 100644 index 00000000000..9773fa9b339 --- /dev/null +++ b/.github/actions/ui-tests/action.yml @@ -0,0 +1,34 @@ +# To be refactored, need to check how DRY can work in the end. +name: UI Tests +description: Runs UI tests and publishes the failure dumps as an artifact on test failure. + +inputs: + artifact-name-suffix: + description: The name of the OS used for the runner (e.g. "ubuntu-latest"). + required: true + +runs: + using: "composite" + steps: + - name: UI Tests + shell: bash + run: | + dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj + - uses: actions/upload-artifact@v2 + if: success() || failure() + with: + name: ui-test-failure-${{ inputs.artifact-name-suffix }} + path: | + test/OrchardCore.Tests.UI/bin/Release/*/FailureDumps + if-no-files-found: ignore + - name: MVC UI Tests + shell: bash + run: | + dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.csproj + - uses: actions/upload-artifact@v2 + if: success() || failure() + with: + name: mvc-ui-test-failure-${{ inputs.artifact-name-suffix}} + path: | + test/OrchardCore.Tests.UI.Mvc/bin/Release/*/FailureDumps + if-no-files-found: ignore \ No newline at end of file diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index d124aa02b19..bd4e718249e 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -25,21 +25,52 @@ jobs: - name: Build run: | dotnet build --configuration Release --framework net6.0 - - name: Unit Tests - run: | - dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - - name: Functional Tests - if: matrix.os == 'ubuntu-latest' + #- name: Unit Tests + # run: | + # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj + #- name: MVC UI Tests + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 + # with: + # build-directory: test/OrchardCore.Tests.UI.Mvc + - name: Set up Azurite + uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-408 + with: + location: test/OrchardCore.Tests.UI + #- name: CMS UI Tests - SQLite + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 + # with: + # build-directory: test/OrchardCore.Tests.UI + #- name: Set up SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-408 + #- name: CMS UI Tests - SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 + # env: + # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" + # with: + # build-directory: test/OrchardCore.Tests.UI + #- name: Start PostgreSQL + # # v1 branch as of 06.11.2022. + # uses: ankane/setup-postgres@fb3b63234a45536dde68bae3f8cf1b6dbbc281cb + #- name: CMS UI Tests - PostgreSQL + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 + # env: + # OrchardCore__UITestingCIDatabaseProvider: "Postgres" + # with: + # build-directory: test/OrchardCore.Tests.UI + # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. + - name: Set up MariaDB + # v1.13.0 + uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + with: + distribution: "mariadb" + root-password: "test123" + - name: Create MariaDB database + shell: pwsh run: | - cd test/OrchardCore.Tests.Functional - npm install - npm run cms:test - npm run mvc:test - - uses: actions/upload-artifact@v2 - if: matrix.os == 'ubuntu-latest' && failure() + mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" + - name: CMS UI Tests - MySql + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 + env: + OrchardCore__UITestingCIDatabaseProvider: "MySql" with: - name: functional-test-failure - path: | - test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots - src/OrchardCore.Cms.Web/App_Data/logs - + build-directory: test/OrchardCore.Tests.UI diff --git a/.github/workflows/preview_ci.yml b/.github/workflows/preview_ci.yml index a43444b5ca1..53233ead0dd 100644 --- a/.github/workflows/preview_ci.yml +++ b/.github/workflows/preview_ci.yml @@ -50,6 +50,10 @@ jobs: path: | test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots src/OrchardCore.Cms.Web/App_Data_Tests/logs + - name: UI Tests + uses: ./.github/actions/ui-tests + with: + os-name: ${{ matrix.os }} - name: Deploy preview nuget packages if: matrix.os == 'ubuntu-latest' run: | diff --git a/.github/workflows/release_ci.yml b/.github/workflows/release_ci.yml index 7e643c8c76c..586595605fb 100644 --- a/.github/workflows/release_ci.yml +++ b/.github/workflows/release_ci.yml @@ -61,6 +61,10 @@ jobs: path: | test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots src/OrchardCore.Cms.Web/App_Data_Tests/logs + - name: UI Tests + uses: ./.github/actions/ui-tests + with: + os-name: ${{ matrix.os }} - name: Deploy release NuGet packages if: matrix.os == 'ubuntu-latest' run: | diff --git a/OrchardCore.sln b/OrchardCore.sln index 79af47faa79..1cab73b0ab2 100644 --- a/OrchardCore.sln +++ b/OrchardCore.sln @@ -440,10 +440,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OrchardCore.Themes", "Orcha EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Autoroute.Core", "src\OrchardCore\OrchardCore.Autoroute.Core\OrchardCore.Autoroute.Core.csproj", "{7F31D1A5-2B6F-448A-9337-482F876B85EF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrchardCore.Security", "src\OrchardCore.Modules\OrchardCore.Security\OrchardCore.Security.csproj", "{B02C00A7-33C2-4FEE-9D0F-B14C349ADB68}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Security", "src\OrchardCore.Modules\OrchardCore.Security\OrchardCore.Security.csproj", "{B02C00A7-33C2-4FEE-9D0F-B14C349ADB68}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Abstractions.Tests", "test\OrchardCore.Abstractions.Tests\OrchardCore.Abstractions.Tests.csproj", "{FE8011DE-D917-4F74-9955-238B2BBA9165}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Tests.UI", "test\OrchardCore.Tests.UI\OrchardCore.Tests.UI.csproj", "{2FADB5D9-E229-4689-A040-12EEE1876285}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OrchardCore.Tests.Themes", "OrchardCore.Tests.Themes", "{61436BAE-FB36-4ADA-8E5D-EE64C4E04522}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OrchardCore.Tests.Features", "OrchardCore.Tests.Features", "{A493E5AD-9046-47F3-87A0-0D3AC7EF8699}" @@ -474,16 +476,37 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.OrchardCoreThemes. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.ResourceManagement.Core", "src\OrchardCore\OrchardCore.ResourceManagement.Core\OrchardCore.ResourceManagement.Core.csproj", "{25C50837-551F-433C-9CED-DD0732523D3D}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{59C52CE8-CE78-4502-8C19-34EC63918BE2}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.FileStorage.AmazonS3", "src\OrchardCore\OrchardCore.FileStorage.AmazonS3\OrchardCore.FileStorage.AmazonS3.csproj", "{38F43FA0-5BA8-4D6B-8F66-C708D590EF76}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Media.AmazonS3", "src\OrchardCore.Modules\OrchardCore.Media.AmazonS3\OrchardCore.Media.AmazonS3.csproj", "{FF1C550C-6D30-499A-AF11-68DE7C8B6869}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.ArchiveLater", "src\OrchardCore.Modules\OrchardCore.ArchiveLater\OrchardCore.ArchiveLater.csproj", "{190C4BEB-C506-4F7F-BDCA-93F3C1C221BC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrchardCore.Features.Core", "src\OrchardCore\OrchardCore.Features.Core\OrchardCore.Features.Core.csproj", "{122EC0DA-A593-4038-BD21-2D4A7061F348}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Features.Core", "src\OrchardCore\OrchardCore.Features.Core\OrchardCore.Features.Core.csproj", "{122EC0DA-A593-4038-BD21-2D4A7061F348}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Search", "src\OrchardCore.Modules\OrchardCore.Search\OrchardCore.Search.csproj", "{7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{01A2BBC1-B9C1-4DD1-825C-A63B6D40F91D}" + ProjectSection(SolutionItems) = preProject + .github\workflows\assets_validation.yml = .github\workflows\assets_validation.yml + .github\workflows\functional_all_db.yml = .github\workflows\functional_all_db.yml + .github\workflows\mac_unit_test_ci.yml = .github\workflows\mac_unit_test_ci.yml + .github\workflows\preview_ci.yml = .github\workflows\preview_ci.yml + .github\workflows\pr_ci.yml = .github\workflows\pr_ci.yml + .github\workflows\release_ci.yml = .github\workflows\release_ci.yml + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "actions", "actions", "{2FF93CCD-E4DF-4086-950B-0F7484C88906}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ui-tests", "ui-tests", "{0B2B9EBE-C008-42A0-9CC0-37727DD8ED0C}" + ProjectSection(SolutionItems) = preProject + .github\actions\ui-tests\action.yml = .github\actions\ui-tests\action.yml + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Tests.UI.Mvc", "test\OrchardCore.Tests.UI.Mvc\OrchardCore.Tests.UI.Mvc.csproj", "{BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1218,6 +1241,10 @@ Global {FE8011DE-D917-4F74-9955-238B2BBA9165}.Debug|Any CPU.Build.0 = Debug|Any CPU {FE8011DE-D917-4F74-9955-238B2BBA9165}.Release|Any CPU.ActiveCfg = Release|Any CPU {FE8011DE-D917-4F74-9955-238B2BBA9165}.Release|Any CPU.Build.0 = Release|Any CPU + {2FADB5D9-E229-4689-A040-12EEE1876285}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FADB5D9-E229-4689-A040-12EEE1876285}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FADB5D9-E229-4689-A040-12EEE1876285}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FADB5D9-E229-4689-A040-12EEE1876285}.Release|Any CPU.Build.0 = Release|Any CPU {A49A2A81-B04C-4240-852A-80A4EEAD3CDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A49A2A81-B04C-4240-852A-80A4EEAD3CDA}.Release|Any CPU.ActiveCfg = Release|Any CPU {C058B5EE-2370-4240-B0AE-0D1C8A37CF41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -1272,10 +1299,6 @@ Global {FF1C550C-6D30-499A-AF11-68DE7C8B6869}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF1C550C-6D30-499A-AF11-68DE7C8B6869}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF1C550C-6D30-499A-AF11-68DE7C8B6869}.Release|Any CPU.Build.0 = Release|Any CPU - {A6563050-EE6D-4E7C-81AA-C383DB3ED124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A6563050-EE6D-4E7C-81AA-C383DB3ED124}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A6563050-EE6D-4E7C-81AA-C383DB3ED124}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A6563050-EE6D-4E7C-81AA-C383DB3ED124}.Release|Any CPU.Build.0 = Release|Any CPU {190C4BEB-C506-4F7F-BDCA-93F3C1C221BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {190C4BEB-C506-4F7F-BDCA-93F3C1C221BC}.Debug|Any CPU.Build.0 = Debug|Any CPU {190C4BEB-C506-4F7F-BDCA-93F3C1C221BC}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -1288,7 +1311,10 @@ Global {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}.Debug|Any CPU.Build.0 = Debug|Any CPU {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}.Release|Any CPU.ActiveCfg = Release|Any CPU {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}.Release|Any CPU.Build.0 = Release|Any CPU - + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1493,6 +1519,7 @@ Global {7F31D1A5-2B6F-448A-9337-482F876B85EF} = {F23AC6C2-DE44-4699-999D-3C478EF3D691} {B02C00A7-33C2-4FEE-9D0F-B14C349ADB68} = {A066395F-6F73-45DC-B5A6-B4E306110DCE} {FE8011DE-D917-4F74-9955-238B2BBA9165} = {B8D16C60-99B4-43D5-A3AD-4CD89AF39B25} + {2FADB5D9-E229-4689-A040-12EEE1876285} = {B8D16C60-99B4-43D5-A3AD-4CD89AF39B25} {61436BAE-FB36-4ADA-8E5D-EE64C4E04522} = {B8D16C60-99B4-43D5-A3AD-4CD89AF39B25} {A493E5AD-9046-47F3-87A0-0D3AC7EF8699} = {B8D16C60-99B4-43D5-A3AD-4CD89AF39B25} {A49A2A81-B04C-4240-852A-80A4EEAD3CDA} = {72E15FB1-45AB-46CB-B332-40FDFDD2B272} @@ -1513,7 +1540,10 @@ Global {190C4BEB-C506-4F7F-BDCA-93F3C1C221BC} = {90030E85-0C4F-456F-B879-443E8A3F220D} {122EC0DA-A593-4038-BD21-2D4A7061F348} = {F23AC6C2-DE44-4699-999D-3C478EF3D691} {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C} = {90030E85-0C4F-456F-B879-443E8A3F220D} - + {01A2BBC1-B9C1-4DD1-825C-A63B6D40F91D} = {59C52CE8-CE78-4502-8C19-34EC63918BE2} + {2FF93CCD-E4DF-4086-950B-0F7484C88906} = {59C52CE8-CE78-4502-8C19-34EC63918BE2} + {0B2B9EBE-C008-42A0-9CC0-37727DD8ED0C} = {2FF93CCD-E4DF-4086-950B-0F7484C88906} + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA} = {B8D16C60-99B4-43D5-A3AD-4CD89AF39B25} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {46A1D25A-78D1-4476-9CBF-25B75E296341} diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 1961db15b39..5bd1661867b 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -26,6 +26,9 @@ + + + diff --git a/src/OrchardCore.Cms.Web/NLog.config b/src/OrchardCore.Cms.Web/NLog.config index 2247283c822..80b2911a6f4 100644 --- a/src/OrchardCore.Cms.Web/NLog.config +++ b/src/OrchardCore.Cms.Web/NLog.config @@ -15,6 +15,8 @@ diff --git a/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj b/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj index 62a73532bfc..c7e0ddbd1ef 100644 --- a/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj +++ b/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj @@ -21,7 +21,7 @@ - + @@ -43,5 +43,9 @@ + + + + diff --git a/src/OrchardCore.Cms.Web/Program.cs b/src/OrchardCore.Cms.Web/Program.cs index 4b4d39392bd..ff99537d96c 100644 --- a/src/OrchardCore.Cms.Web/Program.cs +++ b/src/OrchardCore.Cms.Web/Program.cs @@ -1,10 +1,14 @@ +using System.Diagnostics.CodeAnalysis; using OrchardCore.Logging; var builder = WebApplication.CreateBuilder(args); builder.Host.UseNLogHost(); +var configuration = builder.Configuration; + builder.Services + .AddSingleton(configuration) .AddOrchardCms() .AddSetupFeatures("OrchardCore.AutoSetup"); @@ -20,3 +24,15 @@ app.UseOrchardCore(); app.Run(); + +[SuppressMessage( + "Design", + "CA1050: Declare types in namespaces", + Justification = "As described here: https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-6.0.")] +public partial class Program +{ + protected Program() + { + // Nothing to do here. + } +} diff --git a/src/OrchardCore.Mvc.Web/Program.cs b/src/OrchardCore.Mvc.Web/Program.cs index d93a0dc32b3..7c69f1b05eb 100644 --- a/src/OrchardCore.Mvc.Web/Program.cs +++ b/src/OrchardCore.Mvc.Web/Program.cs @@ -1,6 +1,9 @@ var builder = WebApplication.CreateBuilder(args); +var configuration = builder.Configuration; + builder.Services + .AddSingleton(configuration) .AddOrchardCore() .AddMvc(); @@ -16,3 +19,15 @@ app.UseOrchardCore(); app.Run(); + +[System.Diagnostics.CodeAnalysis.SuppressMessage( + "Design", + "CA1050: Declare types in namespaces", + Justification = "As described here: https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-6.0.")] +public partial class Program +{ + protected Program() + { + // Nothing to do here. + } +} diff --git a/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/footer.html b/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/footer.html index 312f0600bc8..cdcc360fd00 100644 --- a/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/footer.html +++ b/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/footer.html @@ -10,9 +10,9 @@
- - - + + +
Privacy Policy diff --git a/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/landingpage.liquid b/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/landingpage.liquid index eca0a8227a0..52d7ddc96fd 100644 --- a/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/landingpage.liquid +++ b/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/landingpage.liquid @@ -118,17 +118,17 @@

{{ member.DisplayText }}

{{ member.TeamMember.Occupation.Text }}

{% if member.TeamMember.Twitter.Text.size > 0 %} - + {% endif %} {% if member.TeamMember.Facebook.Text.size > 0 %} - + {% endif %} {% if member.TeamMember.LinkedIn.Text.size > 0 %} - + {% endif %} @@ -152,8 +152,8 @@
{% for client in Model.ContentItem.Content.Clients.ContentItems %} {% endfor %} diff --git a/src/OrchardCore.Themes/TheBlogTheme/Recipes/Snippets/footer.html b/src/OrchardCore.Themes/TheBlogTheme/Recipes/Snippets/footer.html index e62908b413a..3ff6cea2c27 100644 --- a/src/OrchardCore.Themes/TheBlogTheme/Recipes/Snippets/footer.html +++ b/src/OrchardCore.Themes/TheBlogTheme/Recipes/Snippets/footer.html @@ -4,7 +4,7 @@