Repository navigation
Revive the test suite; analyzers folder paths; clear_logs (#7 #12 #15) - #46
Merged
Merged
Conversation
VisualText#12 VisualText#15) - VisualText#7: ModuleTest and EngineTest had been skipped since the v3.1.48 submodule bump, the email test commented out. They run again: the fixtures are regenerated from the current analyzers (address and links differ only in JSON layout; telephone and email changed in the analyzers, see VisualText/analyzers#42), and tests no longer leave the module's engine pointed at a temporary folder. - VisualText#12: one analyzer_dir() resolves an analyzer's folder for analyze, compile, input_text, the kb/user helpers and cloud_compile. With an analyzers folder set, compile() returned <folder>/analyzers/<name>, which does not exist, so cloud_compile failed; a relative folder broke analyze(). Paths may be str or Path; Engine(analyzer_path=...) is no longer ignored. - VisualText#15: Engine.clear_logs() / NLPPlus.clear_logs() remove an analyzer's output, logs and input/*_log folders. - set_working_folder() closes the old engine before making the new one: closing an engine breaks another still open (nlp-engine#791), and left to the garbage collector that happened at random. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7, closes #12, closes #15. (#1, the output type through
$datum, needs an engine change first and comes separately.)#7: the test suite runs again.
ModuleTestandEngineTesthad been@unittest.skip-ed since the v3.1.48 submodule bump (blamed on NLP-ENGINE-521, long since fixed). The email test was commented out. All of them run now.+442012341234is now a UK international number, where the old fixture had misparsed area420.test_working_dir, the teardown test andtest_jsonleft the module's engine on a temporary folder, so later tests depended on run order.#12: analyzers folder paths.
Engine.analyzer_dir(name)is now used byanalyze,compile,input_text, thekb/userhelpers andcloud_compile. Fixes:compile()returned<folder>/analyzers/<name>, which doesn't exist, socloud_compilefailed with "Analyzer directory not found";analyze();Engine(analyzer_path=...)was accepted and ignored.strorPath. A relative folder is resolved when it's set.#15:
Engine.clear_logs(name)/NLPPlus.clear_logs(name). Removes the analyzer'soutput,logsandinput/**/*_logfolders, and returns how many it removed. Inputs, specs and KB files are left alone.set_working_folder()now closes the old engine before making the new one. Closing an engine breaks another still open in the process (VisualText/nlp-engine#791, filed with a repro). Left to the garbage collector, that happened at random: the revived suite failed or segfaulted in about half the runs, depending on order. The tests never keep two engines open now.Tested on Windows against the released NLPPlus 2.2.68 (engine 4.2.33), with this package's Python files copied over it:
unittestin three module orders, 3 runs each: 9/9 green. Before the isolation fixes, json-first failed about half the time.AnalyzerFolderTesttests fail on the old code.CI runs the suite on Linux only (
test.yml). This is the first timeEngineTestruns there since the skip, so watch that job.🤖 Generated with Claude Code