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

Fix Functional Tests #13585

merged 74 commits into from
May 18, 2023

Conversation

jtkech
Copy link
Member

@jtkech jtkech commented Apr 22, 2023

Fixes #13635
Fixes #13480

I needed to add the actions/setup-dotnet@v3 step to each test. Now it works for all databases except for MySql for which we get "max key length" errors that seem to be erroneous.

With MySql we get Specified key was too long; max key length is 3072 bytes errors when creating inner indexes in migrations, which seems erroneous, maybe it can be fixed by configuring a different char set and collation, but for now I just commented out the MySql test.

@hishamco
Copy link
Member

Related to #13480

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

- name: Allows NodeJs to find the dotnet command
run: |
shell: pwsh
$Env:Path += [IO.Path]::PathSeparator + "/usr/share/dotnet"
Copy link
Member

Choose a reason for hiding this comment

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

I tried something similar but it didn't work for me, if that's working then it's great. That's weird though that it broke at some point, maybe they have an issue with their base images.

Copy link
Member

Choose a reason for hiding this comment

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

Could it be part of the js script? Or could the js script try to perfix dotnet with this path (which is what I had tried I think).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, will see

Now it fails because it doesn't find powershell ;)

OCI runtime exec failed: exec failed: unable to start container process: exec: "pwsh": executable file not found in $PATH: unknown

Copy link
Member Author

Choose a reason for hiding this comment

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

Could it be part of the js script?

I will check

Copy link
Member

Choose a reason for hiding this comment

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

Failing only with SQLServer, not sure why

Copy link
Member Author

Choose a reason for hiding this comment

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

Because for testing I only updated the SQLServer test

So it means that we would also need to update the PATH for powershell or use directly the available command line in the containers we have initialized.

@jtkech
Copy link
Member Author

jtkech commented May 8, 2023

@sebastienros

For info with mysql (or mariadb) some of our inner indexes keys are too long with the utf8mb4_general_ci collation which now is the default.

So to be able to use the default collation we would need to reduce some of our inner indexes keys.

Finally I could create a step to connect to the mariadb service which runs in its own container, so I needed to install mariadb-client, this to set the test database collation to utf8mb3_general_ci.

Doing this all Functional Tests work, also for MySql.

@sebastienros
Copy link
Member

What size should the indexes be? Where should the change be done? (reducing the size of the index name)

@jtkech
Copy link
Member Author

jtkech commented May 18, 2023

In a given inner index the total of the included columns sizes should not be greater than 3072 bytes.

So with the utf8mb4_general_ci not greater than 3072 / 4 = 768 chars.

I don't remember all the failing inner indexes but easy to retrieve.

For example the IDX_AliasPartIndex_DocumentId

        SchemaBuilder.AlterIndexTable<AliasPartIndex>(table => table
            .CreateIndex("IDX_AliasPartIndex_DocumentId",
                "DocumentId",        // bigint = 8 bytes = 2 chars.
                "Alias",             // MaxAliasLength = 740 chars.
                "ContentItemId",     // 26 chars.
                "Published",         // 1 or 2 bytes for both booleans
                "Latest")
        );                           // Total = 768 chars + (1 or 2 bytes), no luck ;)

@jtkech
Copy link
Member Author

jtkech commented May 18, 2023

Just to say that currently all tests pass with the collation set to utf8mb3_general_ci.

But if you want I can try to reduce the size of the failing inner indexes.

@jtkech jtkech requested a review from sfmskywalker as a code owner May 18, 2023 21:06
@sebastienros
Copy link
Member

We should change the name of the index to work with the defaults. At least that will make new sites work.

And existing sites that don't change the collation and upgrade their mysql version will then have to change their existing ones.

There is a limit defined in yessql AFAIR, Dean worked on that, we may need to update it there too.

@jtkech
Copy link
Member Author

jtkech commented May 18, 2023

@sebastienros

Okay, all tests pass without having to change the MySql collation.

I jus needed to change the size of the Workflow indexes by specifying that the Ids can be limited to 26 chars, and by reducing AliasPart.MaxAliasLength from 740 to 735 chars.

Edited: For info the problem only happens when you define an inner IDX_ index, for example there is no problem with the AutoroutePartIndex for which no inner index is defined, this even if AutoroutePart.MaxPathLength = 1024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to fix Functional Tests. An error occurred while using Mysql to setup tenant
3 participants