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

tests(data-providers): integration tests #47

Merged
merged 30 commits into from
Mar 12, 2023

Conversation

followynne
Copy link
Member

@followynne followynne commented Sep 11, 2022

This PR creates the test suite for the existing data providers and prepares a set of interfaces and default implementations that any future Data Provider could implement, to provide a valid set of expected test cases.

Additional information:

  • I made a default implementation for all the interfaces, that can be reused on new ones (it only needs the IIntegrationRunner configuration)
  • mongodb uses MongoDbRunner as the integration framework
  • mysql, mssql, postgres uses TestContainers
  • elasticsearch uses ElasticSearch.Xunit cluster framework*
  • I noticed that sometimes a project can fail due to Refused Connection to [...] - usually it's only related to the machine that runs the tests, when it happens I only run the affected project and it works 😄

*fyi: I tried for months to use TestContainers on Elastic but I couldn't understand how to solve connectivity issues - right now I was finally able to create this implementation, we can review it later if we prefer another one :)

Traits view:

immagine

@followynne followynne changed the title tests: testcontainers usage first implementation tests(data-providers): integration tests Mar 9, 2023
commit f087218
Merge: 4434538 1d22b8b
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Sat Mar 11 16:15:21 2023 +0330

    Merge pull request serilog-contrib#64 from mo-esmp/dependabot/nuget/src/Serilog.Ui.MongoDbProvider/MongoDB.Driver-2.19.0

    chore(deps): bump MongoDB.Driver from 2.11.5 to 2.19.0 in /src/Serilog.Ui.MongoDbProvider

commit 1d22b8b
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Mar 3 23:31:16 2023 +0000

    chore(deps): bump MongoDB.Driver in /src/Serilog.Ui.MongoDbProvider

    Bumps [MongoDB.Driver](https://github.com/mongodb/mongo-csharp-driver) from 2.11.5 to 2.19.0.
    - [Release notes](https://github.com/mongodb/mongo-csharp-driver/releases)
    - [Commits](mongodb/mongo-csharp-driver@v2.11.5...v2.19.0)

    ---
    updated-dependencies:
    - dependency-name: MongoDB.Driver
      dependency-type: direct:production
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

commit 4434538
Merge: 24f7fe2 75978bd
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Wed Jan 18 10:40:44 2023 +0100

    Merge pull request serilog-contrib#56 from mo-esmp/dependabot/nuget/src/Serilog.Ui.MongoDbProvider/Newtonsoft.Json-13.0.2

    chore(deps): bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /src/Serilog.Ui.MongoDbProvider

commit 24f7fe2
Merge: 388131f fc56cd5
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Wed Jan 18 10:40:29 2023 +0100

    Merge pull request serilog-contrib#57 from mo-esmp/dependabot/nuget/src/Serilog.Ui.ElasticSearchProvider/Newtonsoft.Json-13.0.2

    chore(deps): bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /src/Serilog.Ui.ElasticSearchProvider

commit 388131f
Merge: e8fa4df 62814b3
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Wed Jan 18 10:40:13 2023 +0100

    Merge pull request serilog-contrib#58 from mo-esmp/dependabot/npm_and_yarn/src/Serilog.Ui.Web/json5-2.2.3

    chore(deps): bump json5 from 2.2.1 to 2.2.3 in /src/Serilog.Ui.Web

commit e8fa4df
Merge: b6a7c90 c02dd15
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Wed Jan 18 10:40:00 2023 +0100

    Merge pull request serilog-contrib#60 from igece/dev

    Put schema and table names enclosed in double quotes

commit c02dd15
Author: Israel Gómez de Celis <igcelis@gmail.com>
Date:   Tue Jan 17 23:23:49 2023 +0100

    Double quote Schema and Table names in CountAsync

commit 7e71162
Author: Israel Gómez de Celis <igcelis@gmail.com>
Date:   Tue Jan 17 17:55:47 2023 +0000

    PostgreSQL: Schema and Table names should be enclosed in double quotes

commit bc9eb6e
Author: Israel Gómez de Celis <igcelis@gmail.com>
Date:   Tue Jan 17 17:46:39 2023 +0000

    Initial commit

commit 62814b3
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Jan 8 19:38:20 2023 +0000

    chore(deps): bump json5 from 2.2.1 to 2.2.3 in /src/Serilog.Ui.Web

    Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
    - [Release notes](https://github.com/json5/json5/releases)
    - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
    - [Commits](json5/json5@v2.2.1...v2.2.3)

    ---
    updated-dependencies:
    - dependency-name: json5
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

commit fc56cd5
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Dec 8 12:09:24 2022 +0000

    chore(deps): bump Newtonsoft.Json

    Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.2.
    - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
    - [Commits](JamesNK/Newtonsoft.Json@13.0.1...13.0.2)

    ---
    updated-dependencies:
    - dependency-name: Newtonsoft.Json
      dependency-type: direct:production
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

commit 75978bd
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Dec 8 11:50:41 2022 +0000

    chore(deps): bump Newtonsoft.Json in /src/Serilog.Ui.MongoDbProvider

    Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.2.
    - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
    - [Commits](JamesNK/Newtonsoft.Json@13.0.1...13.0.2)

    ---
    updated-dependencies:
    - dependency-name: Newtonsoft.Json
      dependency-type: direct:production
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

commit b6a7c90
Author: Mohsen Esmailpour <MEsmailpour@suitsupply.com>
Date:   Fri Nov 25 10:43:21 2022 +0100

    Fix UI nuspec. serilog-contrib#55

commit ba64bae
Merge: 81b8163 55fd966
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Fri Nov 25 10:35:23 2022 +0100

    Merge pull request serilog-contrib#54 from sommmen/feature/package-icon

    feat: Add package icon

commit 55fd966
Merge: 1a859ad 81b8163
Author: Dion Leurink <dion@onlineplasticsgroup.com>
Date:   Thu Nov 10 10:40:38 2022 +0100

    fix: merge and fix

commit 81b8163
Author: Mohsen Esmailpour <MEsmailpour@suitsupply.com>
Date:   Thu Nov 10 10:33:50 2022 +0100

    Update SQL Server client version.

commit 4e74c99
Merge: cb7e167 51bb312
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Thu Nov 10 10:24:43 2022 +0100

    Merge pull request serilog-contrib#51 from mo-esmp/dependabot/nuget/src/Serilog.Ui.MsSqlServerProvider/Microsoft.Data.SqlClient-2.1.2

    chore(deps): bump Microsoft.Data.SqlClient from 2.1.1 to 2.1.2 in /src/Serilog.Ui.MsSqlServerProvider

commit cb7e167
Merge: 716afe5 3524a3f
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Thu Nov 10 10:24:17 2022 +0100

    Merge pull request serilog-contrib#53 from mo-esmp/dependabot/npm_and_yarn/src/Serilog.Ui.Web/xmldom/xmldom-0.7.9

    chore(deps): bump @xmldom/xmldom from 0.7.6 to 0.7.9 in /src/Serilog.Ui.Web

commit 716afe5
Author: Mohsen Esmailpour <MEsmailpour@suitsupply.com>
Date:   Thu Nov 10 10:14:03 2022 +0100

    Update nuspec file in UI project.

commit 1a859ad
Author: Dion Leurink <dion@onlineplasticsgroup.com>
Date:   Thu Nov 10 10:11:00 2022 +0100

    feat: package icon

commit 3524a3f
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Nov 10 08:41:44 2022 +0000

    chore(deps): bump @xmldom/xmldom in /src/Serilog.Ui.Web

    Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.7.6 to 0.7.9.
    - [Release notes](https://github.com/xmldom/xmldom/releases)
    - [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
    - [Commits](xmldom/xmldom@0.7.6...0.7.9)

    ---
    updated-dependencies:
    - dependency-name: "@xmldom/xmldom"
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

commit 51bb312
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Nov 10 08:41:36 2022 +0000

    chore(deps): bump Microsoft.Data.SqlClient

    Bumps [Microsoft.Data.SqlClient](https://github.com/dotnet/sqlclient) from 2.1.1 to 2.1.2.
    - [Release notes](https://github.com/dotnet/sqlclient/releases)
    - [Changelog](https://github.com/dotnet/SqlClient/blob/main/CHANGELOG.md)
    - [Commits](dotnet/SqlClient@v2.1.1...v2.1.2)

    ---
    updated-dependencies:
    - dependency-name: Microsoft.Data.SqlClient
      dependency-type: direct:production
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

commit 3e743e0
Author: Mohsen Esmailpour <MEsmailpour@suitsupply.com>
Date:   Thu Nov 10 09:41:05 2022 +0100

    Update UI project version.

commit 887ea89
Merge: 24f8d4c 9b91922
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Wed Nov 9 22:15:04 2022 +0100

    Merge pull request serilog-contrib#50 from sommmen/feature/net7

    feat: Update to net7, removed net5

commit 9b91922
Author: Dion Leurink <dion@onlineplasticsgroup.com>
Date:   Wed Nov 9 11:03:27 2022 +0100

    feat: Update to net7

commit 24f8d4c
Merge: ed08d97 0e58a24
Author: Mohsen Esmailpour <mo.esmp@gmail.com>
Date:   Tue Oct 18 10:17:08 2022 +0200

    Merge pull request serilog-contrib#49 from mo-esmp/dependabot/npm_and_yarn/src/Serilog.Ui.Web/xmldom/xmldom-0.7.6

    chore(deps): bump @xmldom/xmldom from 0.7.5 to 0.7.6 in /src/Serilog.Ui.Web

commit 0e58a24
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Oct 17 21:00:48 2022 +0000

    chore(deps): bump @xmldom/xmldom in /src/Serilog.Ui.Web

    Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.7.5 to 0.7.6.
    - [Release notes](https://github.com/xmldom/xmldom/releases)
    - [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
    - [Commits](xmldom/xmldom@0.7.5...0.7.6)

    ---
    updated-dependencies:
    - dependency-name: "@xmldom/xmldom"
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

commit ed08d97
Merge: e73e67c c5f3340
Author: Mohsen Esmailpour <MEsmailpour@suitsupply.com>
Date:   Mon Sep 12 16:36:09 2022 +0200

    Merge branch 'dev' of https://github.com/mo-esmp/serilog-ui into dev

commit e73e67c
Author: Mohsen Esmailpour <MEsmailpour@suitsupply.com>
Date:   Mon Sep 12 16:35:39 2022 +0200

    Upgrade sample project packages.
@followynne followynne marked this pull request as ready for review March 12, 2023 12:35
@followynne
Copy link
Member Author

followynne commented Mar 12, 2023

Hello @mo-esmp,

I finally (finally - too many months lost on the Elastic tests 😆 ) completed the integration tests for the DataProviders (at least, I hope so).

I added all info in the PR description, let me know if there's anything else I missed 👍
I hope they work fine, my last run after merging dev was fine thus... I hope they run 🛩️

In my opinion, if you test the branch and are fine with it, we could merge it and then we'll be able to review&merge the other PRs (I'd start with yours, if we merge this one 😄 ). Let me know if you agree!

(tests for Ui.Web and frontend will come in a separate PR, ottherwise we'll never merge it 🤣 )

(oh, if it's ok for you, please squash the PR when merging - I made too many commits 🍡 )

@mo-esmp
Copy link
Member

mo-esmp commented Mar 12, 2023

@followynne I appreciate your time and effort in adding tests, it's great work. I'm going to run tests and if everything is fine, I'll approve PRs and merge them. There is always room for improvement and later we will discuss the way to improve tests.
After merging all existing PRs, I'll move the repo to the Serilog-contrib organization and if @sommmen is ok I can also add him as a team member there.

@sommmen
Copy link
Contributor

sommmen commented Mar 12, 2023

@followynne I appreciate your time and effort in adding tests, it's great work. I'm going to run tests and if everything is fine, I'll approve PRs and merge them. There is always room for improvement and later we will discuss the way to improve tests. After merging all existing PRs, I'll move the repo to the Serilog-contrib organization and if @sommmen is ok I can also add him as a team member there.

Sure I'd be happy to help out!

@followynne
Copy link
Member Author

@followynne I appreciate your time and effort in adding tests, it's great work. I'm going to run tests and if everything is fine, I'll approve PRs and merge them. There is always room for improvement and later we will discuss the way to improve tests.
After merging all existing PRs, I'll move the repo to the Serilog-contrib organization and if @sommmen is ok I can also add him as a team member there.

Agreed, that's a great idea for me, @sommmen will be a great addition!

About the project move, that's a nice one - I'll try to review your 2 prs in the next days. About the others I opened, I'll update and check them and I'll write you a comment on each, specifying if it's ok for a check/merge or if I'll close it (to reopen them later on the migrated repo). 🦭🤗

@mo-esmp
Copy link
Member

mo-esmp commented Mar 12, 2023

Approved PR, but some Mongo tests failed for me.

image

@mo-esmp mo-esmp merged commit a41fe14 into serilog-contrib:dev Mar 12, 2023
@followynne followynne deleted the perf/testcontainers-impl branch March 12, 2023 22:42
@followynne
Copy link
Member Author

Approved PR, but some Mongo tests failed for me.

image

I found https://stackoverflow.com/a/75637412/15129749 on the topic, I'm fixing those into #34 😄

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.

None yet

3 participants