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

The tests are running too late #225

Open
EngRajabi opened this issue Dec 15, 2023 · 5 comments
Open

The tests are running too late #225

EngRajabi opened this issue Dec 15, 2023 · 5 comments

Comments

@EngRajabi
Copy link

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
Copy link
Author

This number reached 7 minutes

@EngRajabi
Copy link
Author

Is there a way to speed this up?
@alexanderlinne

@alexanderlinne
Copy link
Collaborator

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

@EngRajabi
Copy link
Author

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

@alexanderlinne
Copy link
Collaborator

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.

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

No branches or pull requests

2 participants