ArchUnitNET icon indicating copy to clipboard operation
ArchUnitNET copied to clipboard

The tests are running too late

Open EngRajabi opened this issue 2 years ago • 5 comments

Consider the following test. It takes about 3 minutes to run. Can I reduce this time?

    private static readonly Assembly[] AssembliesService = Assemblies
        .Where(r => r.FullName!.Contains("ind", StringComparison.OrdinalIgnoreCase) &&
                    r.FullName.Contains("service", StringComparison.OrdinalIgnoreCase))
        .ToArray();

    private static readonly Architecture Architecture =
        new ArchLoader().LoadAssemblies(AssembliesService).Build();

    private static readonly IObjectProvider<Class> EventClasses =
        Classes().That().AreAssignableTo(typeof(EventMessageBaseHandler<>)).As("EventHandler Classes");

    [Fact]
    public void EventClassesShouldHaveCorrect()
    {
        try
        {
            Classes().That().AreAssignableTo(EventClasses)
                .Should().HaveNameEndingWith("EventProcessor")
                .AndShould().BePublic()
                .AndShould().BeSealed()
                .OrShould().BeAbstract()
                .Check(Architecture);
        }
        catch (TypeDoesNotExistInArchitecture)
        {
            //ignored
        }
    }

EngRajabi avatar Dec 15 '23 08:12 EngRajabi

This number reached 7 minutes

EngRajabi avatar Dec 25 '23 07:12 EngRajabi

Is there a way to speed this up? @alexanderlinne

EngRajabi avatar Apr 22 '24 07:04 EngRajabi

Hi @EngRajabi, would you be able to provide an example that reproduces this issue? Ideally a GitHub Link to an example repository.

alexanderlinne avatar Apr 22 '24 10:04 alexanderlinne

Hi @EngRajabi, would you be able to provide an example that reproduces this issue? Ideally a GitHub Link to an example repository.

My repository is private, I cannot share it with you. This sample test, which is sent to you, takes about 8 minutes

EngRajabi avatar Apr 22 '24 11:04 EngRajabi

We of course wouldn't need access to your private repository. Your sample test may take eight minutes on your project, but we obviously can't reproduce this with just the test.

If you'd want our support in investigating this specific issue we'd need you to create a public repository with a minimal example that reproduces this issue.

alexanderlinne avatar Apr 22 '24 12:04 alexanderlinne

Closing this due to inactivity. Feel free to reopen this with an example that reproduces the issue

alexanderlinne avatar Aug 28 '24 18:08 alexanderlinne