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

Fix Functional Tests #13585

Merged
merged 74 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
12e6774
Functional tests
jtkech Apr 20, 2023
5a2c811
Merge remote-tracking branch 'origin/main' into jtkech/functional-tests
jtkech Apr 21, 2023
11641b8
Testing
jtkech Apr 21, 2023
0300cce
testing
jtkech Apr 21, 2023
52789ec
test
jtkech Apr 21, 2023
3030e5f
testing
jtkech Apr 21, 2023
1e2ffdc
testing
jtkech Apr 21, 2023
fd3df04
testing
jtkech Apr 21, 2023
dc80a9d
test
jtkech Apr 21, 2023
b05cc9d
testing
jtkech Apr 21, 2023
a0d4faa
Testing
jtkech Apr 21, 2023
d07eb90
Skip mariadb
jtkech Apr 21, 2023
015fe69
testing mysql image
jtkech Apr 21, 2023
7bb18c5
missing name
jtkech Apr 21, 2023
2ed3181
Testing char set
jtkech Apr 21, 2023
69e0930
Skip again mysql and cleanup
jtkech Apr 21, 2023
588d0e4
Testing env variables
jtkech Apr 21, 2023
8917b54
Revert testing change
jtkech Apr 22, 2023
8b52d55
Minor changes
jtkech Apr 22, 2023
fef0796
Merge remote-tracking branch 'origin/main' into jtkech/functional-tests
jtkech May 4, 2023
2ee6574
Remove dotnet version to test if it still work
jtkech May 4, 2023
092452f
Try to update Path env variable
jtkech May 4, 2023
2aec165
Fix action
jtkech May 4, 2023
b5e6359
Testing bash command
jtkech May 4, 2023
339848e
Revert change
jtkech May 5, 2023
69f3fe2
Missing line
jtkech May 5, 2023
98b3209
Uncomment MySql test, and add comment
jtkech May 5, 2023
47cea9d
Test MySql Functional tests
jtkech May 6, 2023
ad13fb9
Testing MySql Functional tests
jtkech May 6, 2023
072f2ee
Testing
jtkech May 6, 2023
b0266a2
Testing
jtkech May 6, 2023
3099c8a
test MySql
jtkech May 6, 2023
79555d4
testing
jtkech May 6, 2023
874e2cc
testing
jtkech May 6, 2023
0cf3696
Revert change
jtkech May 6, 2023
321b7f5
Test MySql
jtkech May 7, 2023
b81d1e7
Revert change
jtkech May 7, 2023
d5f2b53
Testing MySql
jtkech May 8, 2023
c8fa43e
Testing
jtkech May 8, 2023
7a691c4
test
jtkech May 8, 2023
965579e
Test
jtkech May 8, 2023
b9a1e75
Test
jtkech May 8, 2023
a6ce51f
illegal option
jtkech May 8, 2023
0f08ceb
Test
jtkech May 8, 2023
3203cec
testing
jtkech May 8, 2023
f9d8135
testing
jtkech May 8, 2023
74674b0
update config file path
jtkech May 8, 2023
d506707
Add dir cmd
jtkech May 8, 2023
abaae61
Try docker run cmd
jtkech May 8, 2023
7ca0f0e
Remove testing
jtkech May 8, 2023
8999ff2
Test connection
jtkech May 8, 2023
efcb2c2
test
jtkech May 8, 2023
d6cc9e5
Update host name
jtkech May 8, 2023
871f9ef
Test mariadb command
jtkech May 8, 2023
fac7d82
Set Collation
jtkech May 8, 2023
2d8a1cb
Testing
jtkech May 8, 2023
3616e48
Try other collation
jtkech May 8, 2023
0aed742
Set global variables
jtkech May 8, 2023
c362f41
Database collation
jtkech May 8, 2023
9b55de6
Separate step to set collation
jtkech May 8, 2023
398d1b4
minor tweaks
jtkech May 8, 2023
828739d
Use option full names
jtkech May 8, 2023
6396940
Execute 2 commands in one pass
jtkech May 8, 2023
c141efa
Remove checking command
jtkech May 8, 2023
5ea1996
Test if port mapping is necessary
jtkech May 8, 2023
65087f3
Remove useless comment
jtkech May 8, 2023
8cb8bc3
Merge remote-tracking branch 'origin/main' into jtkech/functional-tests
jtkech May 18, 2023
b4f2ef2
Remove Collation step to retrieve Failing Indexes
jtkech May 18, 2023
ca8ee49
Fix AliasPartIndex size for MySql
jtkech May 18, 2023
928b5ec
Fix Workflow Indexes size for MySql
jtkech May 18, 2023
cd476b0
Try to reduce less indexes sizes
jtkech May 18, 2023
223832e
Minor tweak
jtkech May 18, 2023
9dcee87
Update functional_all_db.yml
sebastienros May 18, 2023
0428ef9
Update functional_all_db.yml
sebastienros May 18, 2023
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
25 changes: 21 additions & 4 deletions .github/workflows/functional_all_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
image: cypress/included:9.6.1
steps:
- uses: actions/checkout@v3
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- uses: actions/setup-node@v3
with:
node-version: "15"
# - name: Fix nuget restore issue
# run: |
# apt update && apt --only-upgrade install ca-certificates -y
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand All @@ -39,6 +40,10 @@ jobs:
image: cypress/included:9.6.1
steps:
- uses: actions/checkout@v3
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Fix nuget restore issue
run: |
apt update && apt --only-upgrade install ca-certificates -y
Expand Down Expand Up @@ -79,6 +84,10 @@ jobs:
OrchardCore__DatabaseProvider: "Postgres"
steps:
- uses: actions/checkout@v3
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Fix nuget restore issue
run: |
apt update && apt --only-upgrade install ca-certificates -y
Expand All @@ -95,7 +104,7 @@ jobs:
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
runs-on: ubuntu-latest
Expand All @@ -115,6 +124,10 @@ jobs:
OrchardCore__DatabaseProvider: "MySql"
steps:
- uses: actions/checkout@v3
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Fix nuget restore issue
run: |
apt update && apt --only-upgrade install ca-certificates -y
Expand Down Expand Up @@ -150,6 +163,10 @@ jobs:
OrchardCore__DatabaseProvider: "SqlConnection"
steps:
- uses: actions/checkout@v3
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Fix nuget restore issue
run: |
apt update && apt --only-upgrade install ca-certificates -y
Expand Down
4 changes: 2 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Alias/Migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace OrchardCore.Alias
{
public class Migrations : DataMigration
{
private IContentDefinitionManager _contentDefinitionManager;
private readonly IContentDefinitionManager _contentDefinitionManager;

public Migrations(IContentDefinitionManager contentDefinitionManager)
{
Expand All @@ -24,7 +24,7 @@ public int Create()

// NOTE: The Alias Length has been upgraded from 64 characters to 767.
// For existing SQL databases update the AliasPartIndex tables Alias column length manually.
// INFO: The Alias Length is now of 740 chars, but this is only used on a new installation.
// INFO: The Alias Length is now of 735 chars, but this is only used on a new installation.
SchemaBuilder.CreateMapIndexTable<AliasPartIndex>(table => table
.Column<string>("Alias", col => col.WithLength(AliasPart.MaxAliasLength))
.Column<string>("ContentItemId", c => c.WithLength(26))
Expand Down
7 changes: 4 additions & 3 deletions src/OrchardCore.Modules/OrchardCore.Alias/Models/AliasPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ namespace OrchardCore.Alias.Models
{
public class AliasPart : ContentPart
{
// Maximum length that MySql can support in an index under utf8 collation is 768,
// minus 1 for the `DocumentId` integer (character size = integer size = 4 bytes),
// Maximum length that MySql can support in an index under utf8mb4 collation is 768,
// minus 2 for the `DocumentId` integer (bigint size = 8 bytes = 2 character size),
// minus 26 for the `ContentItemId` and 1 for the 'Published' and 'Latest' bools.
public const int MaxAliasLength = 740;
// minus 4 to allow at least to add a new integer column.
public const int MaxAliasLength = 735;

public string Alias { get; set; }
}
Expand Down
8 changes: 4 additions & 4 deletions src/OrchardCore.Modules/OrchardCore.Workflows/Migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Migrations : DataMigration
public int Create()
{
SchemaBuilder.CreateMapIndexTable<WorkflowTypeIndex>(table => table
.Column<string>("WorkflowTypeId")
.Column<string>("WorkflowTypeId", c => c.WithLength(26))
.Column<string>("Name")
.Column<bool>("IsEnabled")
.Column<bool>("HasStart")
Expand Down Expand Up @@ -43,9 +43,9 @@ public int Create()
);

SchemaBuilder.CreateMapIndexTable<WorkflowIndex>(table => table
.Column<string>("WorkflowTypeId")
.Column<string>("WorkflowId")
.Column<string>("WorkflowStatus")
.Column<string>("WorkflowTypeId", c => c.WithLength(26))
.Column<string>("WorkflowId", c => c.WithLength(26))
.Column<string>("WorkflowStatus", c => c.WithLength(26))
.Column<DateTime>("CreatedUtc")
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,8 @@ global.log = function(msg) {

// Build the dotnet application in release mode
function build(dir, dotnetVersion) {
global.log("version: 3");

// "dotnet" command arguments.
let runArgs = [
Copy link
Member

Choose a reason for hiding this comment

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

Why change this new code? It's displaying error messages

'build',
'--configuration', 'Release',
'--framework', dotnetVersion
];

// "dotnet" process options.
let runOpts = {
cwd: dir
};

try {
// Run dotnet build process, blocks until process completes.
let { status, error, stderr, stdout } = child_process.spawnSync('dotnet', runArgs, runOpts);

if (error) {
throw error;
}

if (status !== 0) {
if (stderr.length > 0) {
throw new Error(stderr.toString());
}
throw new Error(stdout.toString());
}

console.log(stdout.toString());
console.log('Build successful.');
}
catch (error) {
console.error(error);
console.error('Failed to build.');
}
global.log("Building ...");
child_process.spawnSync("dotnet", ["build", "-c", "Release", "-f", dotnetVersion], { cwd: dir });
}

// destructive action that deletes the App_Data folder
Expand All @@ -65,11 +31,11 @@ function host(dir, assembly, { appDataLocation='./App_Data', dotnetVersion='net7
} else {
build(dir, dotnetVersion);
}
global.log("Starting application ...");
global.log("Starting application ...");

const ocEnv = {};
ocEnv["ORCHARD_APP_DATA"] = appDataLocation;

let server = child_process.spawn(
"dotnet",
[`bin/Release/${dotnetVersion}/` + assembly],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ global.log = function(msg) {
};

// Build the dotnet application in release mode
export function build(dir) {
export function build(dir, dotnetVersion) {
global.log("Building ...");
var result = child_process.spawnSync("dotnet", ["build", "-c", "Release"], { cwd: dir });
global.log("Built ...");
global.log(result.output);
child_process.spawnSync("dotnet", ["build", "-c", "Release", "-f", dotnetVersion], { cwd: dir });
}

// destructive action that deletes the App_Data folder
Expand All @@ -27,7 +25,7 @@ export function host(dir, assembly, { appDataLocation='./App_Data', dotnetVersio
if (fs.existsSync(path.join(dir, `bin/Release/${dotnetVersion}/`, assembly))) {
global.log("Application already built, skipping build");
} else {
build(dir);
build(dir, dotnetVersion);
}
global.log("Starting application ...");

Expand Down