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

OSOE-353: Add duplicate SQL query detector in Lombiq.UITestingToolbox #247

Open
wants to merge 62 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
714dd8c
Adding negative tests
dministro Oct 24, 2022
cd9fc4e
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Oct 24, 2022
21429cc
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Oct 24, 2022
356def6
Updating submodules:
dministro Oct 24, 2022
71f517c
Adjusting spelling configuration
dministro Oct 25, 2022
202de5f
Updating submodules:
dministro Oct 25, 2022
b25919f
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Oct 25, 2022
b496117
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Oct 25, 2022
0fe174a
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Nov 7, 2022
6e0d759
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Dec 3, 2022
b6ee7ea
Moving and renaming test classes
dministro Dec 3, 2022
911e7e4
Updating submodule:
dministro Dec 4, 2022
0b0bd33
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Dec 6, 2022
0cfded9
Fast forwarding submodules
dministro Dec 6, 2022
98d7c37
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Dec 15, 2022
193083c
Update submodules after merge
dministro Dec 15, 2022
c591b3e
Updating submodule:
dministro Dec 15, 2022
92369ce
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Dec 26, 2022
9176288
Updating submodules:
dministro Dec 26, 2022
c9ee570
dummy
dministro Dec 26, 2022
d6c2221
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Jan 13, 2023
5b8f01c
Updating submodules after merge
dministro Jan 13, 2023
6d46a32
Updating submodule:
dministro Jan 13, 2023
ad02b87
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Jan 25, 2023
c994da2
Updating submodules
dministro Jan 25, 2023
c1bae21
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Feb 13, 2023
cb038e9
Updating submodules
dministro Feb 13, 2023
0feaa6f
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Mar 22, 2023
01a7583
Updating submodule:
dministro Mar 22, 2023
240d1e2
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Mar 24, 2023
df31143
Fixes after merge
dministro Mar 24, 2023
6ff1bb2
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Mar 27, 2023
8a2d7ff
Updating submodule:
dministro Mar 27, 2023
8248623
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro May 18, 2023
7a9e00a
Updating submodules
dministro May 18, 2023
0dd8d4c
Reverting pnpm-lock.yaml
dministro May 18, 2023
2e8329d
Adjusting tests to utilize per page configuration
dministro May 19, 2023
467d02b
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Jul 17, 2023
a3f1bf2
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Aug 27, 2023
a568764
Updating submodule:
dministro Aug 27, 2023
f994968
Fixing failing UI tests
dministro Aug 27, 2023
eb5f599
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Sep 3, 2023
90a7802
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Sep 8, 2023
3833992
Removing tests
dministro Oct 1, 2023
41b5000
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Oct 1, 2023
1e02f64
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Oct 19, 2023
a2ee7e2
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Oct 21, 2023
3583fca
[no ci]
dministro Oct 23, 2023
d760cf8
Updating submodule:
dministro Oct 23, 2023
88422d3
Updating submodule:
dministro Oct 23, 2023
f396df0
Reverting changes
dministro Oct 23, 2023
69f1982
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Jan 30, 2024
fdcf2d9
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Apr 9, 2024
3020ee8
Updating submodule:
dministro Apr 9, 2024
cccc2b6
Updating submodule:
dministro Apr 9, 2024
1053c09
Updating submodule:
dministro Apr 9, 2024
6db88a3
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro May 12, 2024
9d85b32
[noci]
dministro May 12, 2024
24b268a
Updating submodules
dministro May 12, 2024
068bac0
Merge branch 'dev' of https://github.com/Lombiq/Open-Source-Orchard-C…
dministro Jul 14, 2024
ad4ab40
Updating submodule:
dministro Jul 14, 2024
c4922c6
Updating submodule:
dministro Jul 14, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ jobs:
spelling:
name: Spelling
uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@dev
with:
spell-check-this: Lombiq/GitHub-Actions@issue/OSOE-353
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,11 @@ public BehaviorChartJsTests(ITestOutputHelper testOutputHelper)
public Task RecipeDataShouldBeDisplayedCorrectly(Browser browser) =>
ExecuteTestAfterSetupAsync(
context => context.TestChartJsSampleBehaviorAsync(),
browser);
browser,
configuration =>
{
configuration.CounterConfiguration.Running.DbReaderReadThreshold = 404;
configuration.CounterConfiguration.Running.DbReaderReadPerNavigationThreshold = 70;
Piedone marked this conversation as resolved.
Show resolved Hide resolved
return Task.CompletedTask;
});
}
8 changes: 7 additions & 1 deletion test/Lombiq.OSOCE.Tests.UI/Tests/RetrievalDataTablesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,11 @@ public BehaviorDataTablesTests(ITestOutputHelper testOutputHelper)
public Task RecipeDataShouldBeDisplayedCorrectly(Browser browser) =>
ExecuteTestAfterSetupAsync(
context => context.TestDataTableRecipeDataAsync(),
browser);
browser,
Piedone marked this conversation as resolved.
Show resolved Hide resolved
configuration =>
{
configuration.CounterConfiguration.Running.DbReaderReadThreshold = 57;
configuration.CounterConfiguration.Running.DbReaderReadPerNavigationThreshold = 57;
return Task.CompletedTask;
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Exceptions;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using Shouldly;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

namespace Lombiq.OSOCE.Tests.UI.Tests.UITestingToolboxTests;

public class CounterTests : UITestBase
{
public CounterTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}

[Theory, Chrome]
public Task RepeatedSqlQueryDuringRunningPhaseShouldThrow(Browser browser) =>
Should.ThrowAsync<CounterThresholdException>(() =>
ExecuteTestAfterSetupAsync(
context => context.SignInDirectlyAndGoToHomepageAsync(),
browser,
configuration =>
{
// The test is guaranteed to fail so we don't want to retry it needlessly.
configuration.MaxRetryCount = 0;

configuration.CounterConfiguration.Running.DbCommandExecutionRepetitionThreshold = 0;

return Task.CompletedTask;
}));

[Theory, Chrome]
public Task DbReaderReadDuringRunningPhaseShouldThrow(Browser browser) =>
Should.ThrowAsync<CounterThresholdException>(() =>
ExecuteTestAfterSetupAsync(
async context => await context.GoToHomePageAsync(onlyIfNotAlreadyThere: false),
browser,
configuration =>
{
// The test is guaranteed to fail so we don't want to retry it needlessly.
configuration.MaxRetryCount = 0;

configuration.CounterConfiguration.Running.DbReaderReadPerNavigationThreshold = 0;

return Task.CompletedTask;
}));
}
2 changes: 1 addition & 1 deletion test/Lombiq.UITestingToolbox
Submodule Lombiq.UITestingToolbox updated 29 files
+11 −1 Lombiq.Tests.UI.Samples/Tests/BasicOrchardFeaturesTests.cs
+64 −0 Lombiq.Tests.UI/Exceptions/CounterThresholdException.cs
+5 −1 Lombiq.Tests.UI/Extensions/NavigationUITestContextExtensions.cs
+62 −0 Lombiq.Tests.UI/Services/CounterConfiguration.cs
+34 −0 Lombiq.Tests.UI/Services/CounterDataCollector.cs
+13 −0 Lombiq.Tests.UI/Services/Counters/CounterKey.cs
+63 −0 Lombiq.Tests.UI/Services/Counters/CounterProbe.cs
+39 −0 Lombiq.Tests.UI/Services/Counters/CounterProbeBase.cs
+50 −0 Lombiq.Tests.UI/Services/Counters/Data/DbCommandCounterKey.cs
+20 −0 Lombiq.Tests.UI/Services/Counters/Data/DbExecuteCounterKey.cs
+20 −0 Lombiq.Tests.UI/Services/Counters/Data/DbReadCounterKey.cs
+131 −0 Lombiq.Tests.UI/Services/Counters/Data/ProbedDbCommand.cs
+90 −0 Lombiq.Tests.UI/Services/Counters/Data/ProbedDbConnection.cs
+168 −0 Lombiq.Tests.UI/Services/Counters/Data/ProbedDbDataReader.cs
+59 −0 Lombiq.Tests.UI/Services/Counters/Extensions/ICounterDataCollectorExtensions.cs
+29 −0 Lombiq.Tests.UI/Services/Counters/ICounterDataCollector.cs
+15 −0 Lombiq.Tests.UI/Services/Counters/ICounterKey.cs
+38 −0 Lombiq.Tests.UI/Services/Counters/ICounterProbe.cs
+13 −0 Lombiq.Tests.UI/Services/Counters/ICounterValue.cs
+14 −0 Lombiq.Tests.UI/Services/Counters/NavigationProbe.cs
+12 −0 Lombiq.Tests.UI/Services/Counters/Value/CounterValue.cs
+8 −0 Lombiq.Tests.UI/Services/Counters/Value/IntegerCounterValue.cs
+13 −7 Lombiq.Tests.UI/Services/OrchardCoreHosting/OrchardApplicationFactory.cs
+8 −1 Lombiq.Tests.UI/Services/OrchardCoreInstance.cs
+5 −0 Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs
+13 −0 Lombiq.Tests.UI/Services/PhaseCounterConfiguration.cs
+24 −0 Lombiq.Tests.UI/Services/ProbedConnectionFactory.cs
+8 −1 Lombiq.Tests.UI/Services/UITestContext.cs
+14 −2 Lombiq.Tests.UI/Services/UITestExecutionSession.cs
2 changes: 1 addition & 1 deletion tools/Lombiq.GitHub.Actions