Code Monkey home page Code Monkey logo

Comments (6)

xiaomi7732 avatar xiaomi7732 commented on June 15, 2024

@EPinci, thanks for the report. By a brief look, it feels like a bug. Let me dive deeper and see what might cause the issue. At the same time, is it possible to share one of the failed unit tests with us? That might help locate the issue.

Thank you again for the report.

from applicationinsights-kubernetes.

EPinci avatar EPinci commented on June 15, 2024

Hey, I'm running almost plain vanilla integration tests per https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-6.0

namespace Testing.Fixtures
{
    public class CustomWebApplicationFactoryFixture<TStartup> : WebApplicationFactory<TStartup> where TStartup: class
    {
        protected override void ConfigureWebHost(IWebHostBuilder builder)
        {
            builder.ConfigureServices(services =>
            {
                var descriptor = services.SingleOrDefault(
                    d => d.ServiceType == typeof(DbContextOptions<MyContext>));
                services.Remove(descriptor);

                services.AddDbContext<MyContext>(options => {
                    options.UseInMemoryDatabase("IntegrationTestsDB");
                }, optionsLifetime: ServiceLifetime.Singleton);

                TestDataUtils.InitializeContext(services);
            });
        }
    }
}
namespace API.Test.Integrations
{
    [Trait("Category", "Integration")]
    [Collection("WebAppCollection")]
    public class HealthzTest
    {
        private readonly HttpClient _client;

        public HealthzTest(CustomWebApplicationFactoryFixture<Startup> factory)
        {
            _client = factory.CreateClient();
        }

        [Fact]
        public async Task GetHealthz()
        {
            // The endpoint or route of the controller action.
            var httpResponse = await _client.GetAsync("/healthz");

            // Must be successful.
            httpResponse.EnsureSuccessStatusCode();
        }
    }
}

from applicationinsights-kubernetes.

xiaomi7732 avatar xiaomi7732 commented on June 15, 2024

Hi @EPinci, thanks for the info. I think I found the issue. Working on a fix. Will post the PR here when it is ready for review.

from applicationinsights-kubernetes.

xiaomi7732 avatar xiaomi7732 commented on June 15, 2024

Released in 3.1.0-beta1: https://www.nuget.org/packages/Microsoft.ApplicationInsights.Kubernetes/3.1.0-beta1.
@EPinci, do you mind giving it a try?

Thanks.

from applicationinsights-kubernetes.

EPinci avatar EPinci commented on June 15, 2024

@xiaomi7732 This build looks good to me. Thank you!

from applicationinsights-kubernetes.

xiaomi7732 avatar xiaomi7732 commented on June 15, 2024

I am glad to hear that. Thank you for the quick turnaround.

from applicationinsights-kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.