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

Turn on the CI build for PRs #204

Merged
merged 7 commits into from
Nov 15, 2024
Merged

Conversation

gdziadkiewicz
Copy link
Contributor

@gdziadkiewicz gdziadkiewicz commented Nov 2, 2024

Fixes #106

TODO:

  • Confirm that tests are really being executed on each of the platforms with expected frameworks
  • Confirm how the tests results look like for failing build and failing tests and document
  • (optional) Introduce caching for fixed part (npm build deps, nuget test deps?)

@gdziadkiewicz
Copy link
Contributor Author

@FreeAndNil FreeAndNil added this to the 3.0.3 milestone Nov 2, 2024
@FreeAndNil
Copy link
Contributor

@gdziadkiewicz can you test how just using "dotnet test" as a single step would look like?
@fluffynuts do you have an idea why the windows output is much longer? (the macos and linux output are missing important inforamtion)

@gdziadkiewicz
Copy link
Contributor Author

gdziadkiewicz commented Nov 4, 2024

@gdziadkiewicz can you test how just using "dotnet test" as a single step would look like? @fluffynuts do you have an idea why the windows output is much longer? (the macos and linux output are missing important inforamtion)

Will do.

@gdziadkiewicz
Copy link
Contributor Author

run: |
npm update -g npm --no-progress
npm install --no-progress
npm test

- name: Build
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: build step is not required - npm test will build as a pre-requisite

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true, but it's easier to tell what failed when the phases are separated.

@fluffynuts
Copy link
Contributor

fluffynuts commented Nov 4, 2024

@gdziadkiewicz can you test how just using "dotnet test" as a single step would look like? @fluffynuts do you have an idea why the windows output is much longer? (the macos and linux output are missing important inforamtion)

Will do.

the windows output looks like the output from npm test where the other two look like the output from dotnet test - the default verbosity on dotnet test will only dump out failing tests.

I'd like to suggest that you install the Quackers test logger (https://www.nuget.org/packages/quackers.testlogger) - in conjunction with zarro, you'll get easier-to-read output (colored, with pass/fail icons) and it will suppress duplicate logging from the dotnet logger. This mechanism also allows for faster testing by running test assemblies in parallel, if log4net is ever looking at having a second tests assembly (or looking to reduce overall test-time: split existing tests across multiple test assemblies, as long as they all have a name ending in .Tests. Parallel testing is a fairly large reason why I use this approach everywhere.

Alternatively, if y'all really want to eschew npm test, I suggest raising the verbosity for dotnet test - but I still heartily recommend the zarro / quackers route (both are written by me, and are our defaults at work) as you'll get the best output that way (eg: see https://github.com/fluffynuts/NExpect/actions/runs/11629746737/job/32387287891 for an example)

@FreeAndNil
Copy link
Contributor

@fluffynuts we already use Quackers test logger in log4net.Tests.

@FreeAndNil
Copy link
Contributor

FreeAndNil commented Nov 4, 2024

Here is the log from the dotnet test run https://github.com/gdziadkiewicz/logging-log4net/actions/runs/11660840781/job/32463975074

@gdziadkiewicz dotnet test brings the full output on all platforms.

dotnet-version: 8
dotnet-quality: ga

- name: Build
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove this step since dotnet test also builds the DLLs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would rather not do that. With separate steps, it's easy to see without digging into whether it's a build issue or a failing tests issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point.

@gdziadkiewicz
Copy link
Contributor Author

@gdziadkiewicz can you test how just using "dotnet test" as a single step would look like? @fluffynuts do you have an idea why the windows output is much longer? (the macos and linux output are missing important inforamtion)

Will do.

the windows output looks like the output from npm test where the other two look like the output from dotnet test - the default verbosity on dotnet test will only dump out failing tests.

I'd like to suggest that you install the Quackers test logger (https://www.nuget.org/packages/quackers.testlogger) - in conjunction with zarro, you'll get easier-to-read output (colored, with pass/fail icons) and it will suppress duplicate logging from the dotnet logger. This mechanism also allows for faster testing by running test assemblies in parallel, if log4net is ever looking at having a second tests assembly (or looking to reduce overall test-time: split existing tests across multiple test assemblies, as long as they all have a name ending in .Tests. Parallel testing is a fairly large reason why I use this approach everywhere.

Alternatively, if y'all really want to eschew npm test, I suggest raising the verbosity for dotnet test - but I still heartily recommend the zarro / quackers route (both are written by me, and are our defaults at work) as you'll get the best output that way (eg: see https://github.com/fluffynuts/NExpect/actions/runs/11629746737/job/32387287891 for an example)

WIP

@gdziadkiewicz
Copy link
Contributor Author

Hi all, I amended the csproj to use quackers by default, and it looks great (I'm a new fan!). As for Zarro, at the moment, the builds are taking longer with it than without it (especially for Windows, it's 2x longer), and there is this surprising requirement of having node/npm to build a dotnet project. Would going with Quackers and dropping Zarro be acceptable? Open to discuss @fluffynuts @FreeAndNil

P.S. From now on, I will respond much more quickly.

@FreeAndNil
Copy link
Contributor

I would like to skip zarro at this point and add it later in case we need it.
It was the best approach when it was added, because the dotnet tool could not support our use case and the legacy frameworks.
But now it does all we need.

@fluffynuts
Copy link
Contributor

fluffynuts commented Nov 14, 2024

Hi all, I amended the csproj to use quackers by default, and it looks great (I'm a new fan!). As for Zarro, at the moment, the builds are taking longer with it than without it (especially for Windows, it's 2x longer), and there is this surprising requirement of having node/npm to build a dotnet project. Would going with Quackers and dropping Zarro be acceptable? Open to discuss @fluffynuts @FreeAndNil

P.S. From now on, I will respond much more quickly.

The only problem that I can think of with using quackers without zarro is that the dotnet test system has a bug (I opened an issue, and they took months to get back to me, and basically said "yeah, we know, but we're re-working all of the test internals, so we're closing this") where it doesn't suppress all console logging, even when explicitly told to only use quackers - in particular, you'll see failures twice, though the final stats and all output by quackers will be the same.

Zarro contains hacks to suppress re-echoing these outputs, by instructing quackers to prepend all log lines with an obscure string sequence that it can use to decide if a log line comes from quackers or not.

I also expect that the longer build time via zarro is largely due to the legacy behavior of splitting nuget restore and build - msbuild didn't use to restore packages on build, where it does now. I should probably look into that at some point, but builds have been adequately fast for all the use-cases I've encountered, so it hasn't been high priority.

@FreeAndNil
Copy link
Contributor

@fluffynuts are you OK with skipping zarro in the pipeline for now?

@fluffynuts
Copy link
Contributor

@fluffynuts are you OK with skipping zarro in the pipeline for now?

Sure, if you want to. Zarro does a lot of things and a lot of them are not required for log4net. I know the node/npm requirement can be confusing for some - part of the aim is standardizing how we (me,my work, etc) build and test things, ie via npm run build and npm test (and zarro makes extension of the tasking system really easy) instead of having to read documents on how to build, etc. For CI, I guess it doesn't matter much.

@FreeAndNil
Copy link
Contributor

@gdziadkiewicz LGTM.
Can you make a test fail so that we can see that the pipeline fails?

@gdziadkiewicz gdziadkiewicz marked this pull request as ready for review November 14, 2024 22:55
@fluffynuts
Copy link
Contributor

Here is a build error https://github.com/gdziadkiewicz/logging-log4net/actions/runs/11842227538/job/33000348058?pr=1 and here is a failing test https://github.com/gdziadkiewicz/logging-log4net/actions/runs/11845311348/job/33010485591?pr=1

the output from quackers is looking better than i expected without zarro (:

@FreeAndNil
Copy link
Contributor

Nice, thanks a lot.

@FreeAndNil FreeAndNil merged commit 2d68abc into apache:master Nov 15, 2024
3 checks passed
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.

Enable automatic test runs on commit
3 participants