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

Add NET FX MongoDb integration tests #2490

Merged
merged 4 commits into from
Apr 25, 2023

Conversation

RassK
Copy link
Contributor

@RassK RassK commented Apr 24, 2023

Why

Fixes #2451

What

Makes MongoDb integration tests to run also on Windows with Windows containers.

Tests

Existing, running also on GH windows machine.

Checklist

  • New features are covered by tests.

@RassK RassK requested a review from a team April 24, 2023 17:41
@pjanotti
Copy link
Contributor

The fact that Windows run finished in 16 minutes made me very suspicious 😄:

<?xml version="1.0" encoding="utf-8"?>
<TestRun id="10698e19-e8ff-4562-b1ce-b664ff97120a" name="runneradmin@fv-az618-438 2023-04-24 17:56:54" runUser="fv-az618-438\runneradmin" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <Times creation="2023-04-24T17:56:54.4748963+00:00" queuing="2023-04-24T17:56:54.4748966+00:00" start="2023-04-24T17:56:51.9800460+00:00" finish="2023-04-24T17:56:54.4756026+00:00" />
  <TestSettings name="default" id="1676d9e7-c147-45f1-a720-f62cebbc764d">
    <Deployment runDeploymentRoot="runneradmin_fv-az618-438_2023-04-24_17_56_54" />
  </TestSettings>
  <TestLists>
    <TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestList name="All Loaded Results" id="19431567-8539-422a-85d7-44ee4e166bda" />
  </TestLists>
  <ResultSummary outcome="Completed">
    <Counters total="0" executed="0" passed="0" failed="0" error="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
    <Output>
      <StdOut>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit Desktop .NET 4.0.30319.42000)&#xD;
[xUnit.net 00:00:01.19]   Discovering: IntegrationTests (app domain = on [shadow copy], method display = ClassAndMethod, method display options = None)&#xD;
[xUnit.net 00:00:01.38]   Discovered:  IntegrationTests (found 63 test cases)&#xD;
[xUnit.net 00:00:01.39]   Starting:    IntegrationTests (parallel test collections = off, max threads = 2)&#xD;
[xUnit.net 00:00:01.43]   Finished:    IntegrationTests&#xD;
</StdOut>
    </Output>
    <RunInfos>
      <RunInfo computerName="fv-az618-438" outcome="Warning" timestamp="2023-04-24T17:56:54.2755772+00:00">
        <Text>[xUnit.net 00:00:01.39] IntegrationTests: Exception filtering tests: Incorrect format for TestCaseFilter Error: Missing operand. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed.</Text>
      </RunInfo>
      <RunInfo computerName="fv-az618-438" outcome="Warning" timestamp="2023-04-24T17:56:54.3497632+00:00">
        <Text>No test matches the given testcase filter `&amp;Containers!=Linux` in D:\a\opentelemetry-dotnet-instrumentation\opentelemetry-dotnet-instrumentation\test\IntegrationTests\bin\Release\net462\IntegrationTests.dll</Text>
      </RunInfo>
      <RunInfo computerName="fv-az618-438" outcome="Warning" timestamp="2023-04-24T17:56:54.4159770+00:00">
        <Text>Data collector 'Blame' message: All tests finished running, Sequence file will not be generated.</Text>
      </RunInfo>
    </RunInfos>
  </ResultSummary>
</TestRun>

Copy link
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

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

It will also require changing the test fixture since the Windows image for MongoDB has a different name than the one for Linux.

@RassK
Copy link
Contributor Author

RassK commented Apr 25, 2023

It will also require changing the test fixture since the Windows image for MongoDB has a different name than the one for Linux.

I think the name is the same mongo, it will resolve the platform specific tag automatically.
At least that's how it has been working on my setup.

@Kielek
Copy link
Contributor

Kielek commented Apr 25, 2023

Last time when I tried it was blocked by testcontainers/moby-ryuk#35

@RassK
Copy link
Contributor Author

RassK commented Apr 25, 2023

Last time when I tried it was blocked by testcontainers/moby-ryuk#35

I'm still trying to understand where this dependency is coming from? We have ASP.NET FX tests successfully running windows containers for a long time?

@Kielek
Copy link
Contributor

Kielek commented Apr 25, 2023

Sure, but we are doing similar things in our code base, see DockerNetworkHelper

var mongoContainersBuilder = new ContainerBuilder()
.WithImage(MongoDBImage)
.WithName($"mongo-db-{port}")
.WithPortBinding(port, MongoDBPort)
.WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(MongoDBPort));
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@Kielek Kielek enabled auto-merge (squash) April 25, 2023 12:42
@Kielek Kielek merged commit e32ab1e into open-telemetry:main Apr 25, 2023
@pjanotti
Copy link
Contributor

I think the name is the same mongo, it will resolve the platform specific tag automatically.
At least that's how it has been working on my setup.

I didn't know that it did that! I thought it required a different name.

@RassK RassK deleted the netfx-mongodb-tests branch October 4, 2024 08:33
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.

Add MongoDB CI integration test for .NET Framework.
3 participants