Repository navigation
MCP server: accunit-tests skill and tools to import, export and remove test classes - #93
Merged
Merged
Conversation
Start with accunit_generate_test_class and do not read the source of the module under test; ask the developer once how to handle behavior that cannot be derived. Use the VBA error number for Assert.Throws, restrict Ignore to open expected behavior and note explicit skill invocation.
Import test classes and test related modules from source files with the import of the AccUnit core, so writing tests no longer depends on msaccess-vcs. Files are converted to the ANSI code page, get the class export header if missing and are saved with DoCmd.Save to avoid the Save As dialog on quit. Modules that are not test modules are never replaced. The draft returns the AccUnit test folder.
accunit_export_test_classes and accunit_remove_test_classes work only on test modules and keep files they write over as .bak. The skill now creates a second test class first and asks the developer whether to merge it, replace the existing class or keep both.
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.
Summary
Writing AccUnit tests with an AI agent no longer depends on other tools (e.g. msaccess-vcs) to get test classes into the database.
Skill
accunit-testsand server instructionsaccunit_install_skill, short server instructions for clients without skill support.accunit_generate_test_class; the agent does not read the code under test on its own. If expected behavior cannot be derived, it asks the developer once how to proceed (assume values, look at the code, developer specifies, leave out).Assert.Throwswith the VBA error number,Ignoreonly for open expected behavior, start withaccunit_generate_test_class, explicit skill invocation note in the README.New tools
accunit_import_test_classes(fileNameFilter, importPath): imports test classes and test related modules with the import of the AccUnit core. Only modules with'AccUnit:TestClass/'AccUnit:TestRelated; other modules are never replaced. UTF-8 or ANSI input is converted to a temporary ANSI copy with CRLF; code without export header gets the class header. Imported modules are saved withDoCmd.Save acModule, otherwiseQuit(acQuitSaveAll)shows a modal "Save As" dialog.accunit_export_test_classes(classNames, overwrite)andaccunit_remove_test_classes(classNames, exportBeforeRemoving): single test modules only; files written over are kept as.bak.accunit_generate_test_classreturns the AccUnit test folder (testFolder).modCalcTests1) first, then asks the developer to merge, replace or keep both.Tests
Follow-up