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
Change the "mirror" command to completely mirror gCLI #942
Conversation
Codecov Report
@@ Coverage Diff @@
## main #942 +/- ##
============================================
+ Coverage 27.21% 27.25% +0.04%
- Complexity 12795 12819 +24
============================================
Files 1029 1029
Lines 160441 160443 +2
Branches 35313 35314 +1
============================================
+ Hits 43656 43725 +69
+ Misses 108799 108723 -76
- Partials 7986 7995 +9
Continue to review full report at Codecov.
|
src/net/sourceforge/kolmafia/textui/command/MirrorLogCommand.java
Outdated
Show resolved
Hide resolved
…LI instead of previous usage" This reverts commit 89ba30b.
I still don't have a failing test. I believe the hypothesis that the presence of absence of HTML influences the logging is incorrect. I mirror'd prefref and got raw html. I renamed the file to be .html and it rendered as expected. I'm willing to force the extension to be txt unless the USER explicitly typed .htm or .html |
The test will fail if you revert the changes in request logger |
OK your test is failing for me but the problem is the test. getMirrorLog is not actually reading the file. More later since I am waiting for a meeting that just started. |
Bolloxed up my changes to RequestLogger... |
I think my change to RequestLogger is equivalent to yours but it took me a while to see that. I didn't change printList similarly because I wasn't certain things weren't being written twice. The test should be restored so it allows htm and html if the user specified the ext. but I haven't done that yet. I'd like some real world testing but I think we are closer than we were before. |
I'd like a test for printList and then I think I'd approve this, or more likely, open it for review first :-) |
I'm not happy. mirroring ashq print("Mirror test."); now adds |
Actually, that's unchanged behavior. |
Actually GitHub ate my "less than b r greater than". I was trying to say mirroring ashq print("Mirror test."); now adds an HTML break in the mirror. There's probably a test here. |
Yes, which is what the html test is? That test would previously fail. |
I wonder if we are at cross-purposes? My goals: Everything that is written to the gCLI when mirror is enabled is also written to the mirror file. Nothing is duplicated in the mirror unless it was duplicated in the gCLI. Nothing is in the mirror unless it was also in the gCLI. gCLI text with embedded HTML in the gCLI will be written as text with HTML tags to the mirror. gCLI text with no embedded HTML will not have embedded HTML in the mirror. In addition to automated testing a human using a text editor and with the gCLI on screen should be able to confirm that the gCLI and the mirror have the same content. |
That sounds right. I understand that your problem is the line break? That's a part of what's written to gcli which confuses me on what you're expecting |
I made a version of MirrorTest that executes against main, without these changes. At this point I'm not certain our tests for this change are correct but step 1 is to understand the existing behaviour. |
Tweaked some of the test assertions to have more useful error messages if they fail. But left some others, at least until someone objects.
Another working test.
Some cleanup regarding expectation of HTML
Closing in favor of #981 |
Marked as draft, pending resolution of conversation.
This change replaces the previous usage of mirror which is not well understood, and doesn't seem of interest to most users.
This change allows you to log all gCLI output to a file, allowing you to open it in a browser and view the full html of your session.