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

dotnet-ef: Consider showing output that the project is building #15787

Closed
nphmuller opened this issue May 23, 2019 · 12 comments
Closed

dotnet-ef: Consider showing output that the project is building #15787

nphmuller opened this issue May 23, 2019 · 12 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported good first issue This issue should be relatively straightforward to fix. type-enhancement
Milestone

Comments

@nphmuller
Copy link

nphmuller commented May 23, 2019

My project takes a while to build. When running dotnet ef commands like dotnet ef migrations add MyMigration the project often gets build first. At the stage when the project starts building dotnet ef has not written any output to the console yet, and it will not write anything to the console until the build has finished. I know that I can see the build output via -v or --verbose, but it would be more clear to me if the non-verbose version output a single line of text like Project is building.... It would make the dotnet ef tool feel more responsive, at least for me.

So please consider showing output indicating that the project is building.

Further technical details

dotnet ef --version output:

Entity Framework Core .NET Command-line Tools
2.2.4-servicing-10062
@bricelam
Copy link
Contributor

I have an old branch with this change I've been meaning to get back to...

@nphmuller
Copy link
Author

Looks perfect! :)

@bricelam
Copy link
Contributor

#12049 is also about making sure we’re not doing anything that slows it down.

@ajcvickers ajcvickers added help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. type-enhancement good first issue This issue should be relatively straightforward to fix. and removed help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. labels May 31, 2019
@ajcvickers ajcvickers added this to the Backlog milestone May 31, 2019
@ajcvickers
Copy link
Contributor

For anyone choosing to implement this, please see @bricelam's branch above for a starting point.

@divega divega added help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. and removed good first issue This issue should be relatively straightforward to fix. labels May 31, 2019
@bricelam bricelam added the good first issue This issue should be relatively straightforward to fix. label May 31, 2019
@ajcvickers ajcvickers removed the help wanted This issue involves technologies where we are not experts. Expert help would be appreciated. label Aug 5, 2019
@skalpin
Copy link
Contributor

skalpin commented Aug 16, 2019

@bricelam, I am considering working on this issue. How can I test the output of dotnet ef?

@bricelam
Copy link
Contributor

@skalpin Type dotnet ef :trollface:

Just kidding. I do this:

cd C:\Path\To\EntityFrameworkCore
restore
.dotnet\dotnet run -p src\dotnet-ef -- dbcontext list -p C:\Path\To\DummyProject --verbose

@skalpin
Copy link
Contributor

skalpin commented Aug 19, 2019

cd C:\Path\To\EntityFrameworkCore
restore
.dotnet\dotnet run -p src\dotnet-ef -- dbcontext list -p C:\Path\To\DummyProject --verbose

I am getting
The application to execute does not exist: 'C:\dev\EntityFrameworkCore\artifacts\bin\dotnet-ef\Debug\netcoreapp5.0\tools\netcoreapp2.0\any\ef.dll'

I checked and this directory C:\dev\EntityFrameworkCore\artifacts\bin\dotnet-ef\Debug\netcoreapp5.0\ doesn't have a tools folder.

Do I need to build a specific project?

@bricelam
Copy link
Contributor

That's expected--you need to run from the global tool package to make it work end to end.

But, if you get that error, all the dotnet-ef logic has executed.

@skalpin
Copy link
Contributor

skalpin commented Aug 20, 2019

I rebased your branch onto release/3.0-preview9 here.

What needs to change to complete it?
Why use args.Add("/verbosity:detailed"); instead of args.Add("/verbosity:quiet"); ?

@bricelam
Copy link
Contributor

That change (detailed) was to debug the build perf. You can revert it

skalpin added a commit to skalpin/EntityFrameworkCore that referenced this issue Aug 20, 2019
@skalpin
Copy link
Contributor

skalpin commented Aug 20, 2019

I tried to capture the output in a unit test

[Fact]
        public void Build_started_note()
        {
            using (var sw = new StringWriter())
            {
                var eol = Environment.NewLine;
                Console.SetOut(sw);
                Reporter.IsVerbose = true;
                var project = new Project(@"DummyProject\DummyProject.csproj", null, null, null);
                project.Build();
                var output = sw.ToString();
                Assert.True(output.Contains("Build started"));
                Assert.True(output.Contains("Build succeeded."));
            }
        }

but I'll need a dummy project.
Is there another way to unit test the output of Project.Build()?
Should I make the PR without a unit test?

@bricelam
Copy link
Contributor

No need for a unit test—they get too flakey. Just verify manually.

@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 23, 2019
@bricelam bricelam modified the milestones: Backlog, 3.1.0 Aug 23, 2019
@bricelam bricelam self-assigned this Aug 23, 2019
bricelam added a commit to skalpin/EntityFrameworkCore that referenced this issue Aug 23, 2019
@ajcvickers ajcvickers modified the milestones: 3.1.0, 3.1.0-preview1 Oct 15, 2019
@ajcvickers ajcvickers modified the milestones: 3.1.0-preview1, 3.1.0 Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported good first issue This issue should be relatively straightforward to fix. type-enhancement
Projects
None yet
Development

No branches or pull requests

5 participants