-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add API approvals to tests #504
Conversation
Well, the PR works ... sort-of. It won't pass tests because the CI build does not have So, while the PR accurately identifies that the build is broken ... the build is broken. I'm going to try modifying the build workflow until I can identify the problem. |
So you say the recently published 1.5.0 nugget package is broken? Or did you mean the build for this specific PR was broken? |
The recently published NuGet package 1.5.0 doesn’t have any I was able to fix the issue by using dotnet build instead of msbuild in the CI script. (We can see the test passes now.) |
I’d probably release 1.5.1 if it was me, but the only affect will be people on net6.0 trying to create a base64 QR code encoded as gif/jpeg. They would get a build warning before attempting it in production and getting an exception. |
Thanks for your help. I will release 1.5.1 this evening (GMT+2 - don't know if it's your evening, too). But I don't nevertheless I don't understand how msbuild could produce this error. I would understand it, if Ms build failed the build completely, but it built. There's was an artifact produced. I would have expected to see at least some errors. :-/ By the way - same old story. I chose msbuild over dotnet build for a reason, but can't remember the reason anymore. (Probably the reason is also overhauled over the years...) |
@codebude Now that 1.5.1 is released, what are your feelings towards additional improvements? If you have the time to review additional PRs, I may have time to provide a few more PRs. Most specifically for v1.x, I would like to provide a performance update PR. For v2, I could assist with PR(s) to split off System.Drawing.Common functionality and bring SkiaSharp and ImageSharp to QRCoder. Finally, I may be able to assist with improvements with the CI scripts. For instance, currently all tests run on Windows; it would not be difficult to also run tests on Linux. |
Taking the time for reviews is the least I can do if you're already devoting so much work/time to the QRCoder. So yes, gladly!
That sounds like a great idea. Performance optimizations are always welcome.
Here I would ask you to wait a little bit. I have been thinking about version 2.0 for the last few days and have identified a few points that need to be clarified before we start with a 2.0. I am currently preparing a larger post here in which I would like to collect feedback from the community first.
This is also a great idea that can already be implemented now (before version 2.0). Additional tests under Linux would certainly not do any harm. It might also be a possibility to work on the performance of the CI/build scripts. The total execution time of 12-15 minutes is already very slow and sometimes painful... There may still be scope for runtime optimization here too. |
Sounds good. Look for a performance PR soon. So far it cuts down the memory allocation for small QR codes by about 50%, and large ones by about 30%. I'm only about halfway done though. It's going to change a lot of code, however, but not the structure (the method names are all the same, and the signatures change very little). I could just change a few methods per PR if you want it broken out more. |
Within the performance PR, in certain areas I may include all the old code as comments, so it's easier to see what was translated to what - if GitHub's compare is inadequate. Then we can delete the comments after you've had time to review the code. |
(no public API changes, of course) |
That sounds like a plan. In general I think we've a very complete/robust set of test cases around the core generator so that even bigger code changes might be tested accordingly. Nevertheless I'll have a deeper look onto the changes and might pull out the ISO Norm I used back then when implementing the generator initially. ;-) |
Summary
This pull request integrates API Approvals into our testing framework, designed to ensure that all changes to the public APIs of our projects are deliberate and documented. This feature automatically generates or updates a snapshot of the public API in a text document for each project and target framework during local tests. During continuous integration, these snapshots are verified to ensure they have been appropriately updated and included in the pull request.
Implementation Details
Benefits
Conclusion
The addition of automated API Approvals and snapshot updates to our testing and integration processes significantly strengthens our control over the project's public interfaces. This integration ensures high standards of compatibility and reliability, shielding end-users from unintended changes and fostering a stable development environment.