Add BATS unit test suite (105 tests)#301
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
Add a BATS-based test suite with 105 tests covering: - install-extras.sh core functions (runAuto, removeAll, copyModule, deleteModule, startCmd, argument parsing, REGEX validation) - Scriptmodule structure validation (shebangs, required metadata fields, syntax checks, directory structure, duplicate ID detection) - Wrapper script validation (remove-extras.sh, update-extras.sh) Known pre-existing issues in the repo are documented as tracked tests: - golang-1.17.sh: missing shebang - lr-bsnes-jg.sh, lr-gearcoleco.sh, lr-bsnes-hd.sh: syntax errors - supermodel/, openxcom/: shared data dirs without exact-name scripts Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
The repository had zero test coverage. This PR adds a BATS test suite under
tests/with 105 tests across three test files:tests/install_extras.bats(47 tests)Tests
install-extras.shcore logic in isolation using temp directories:-a/--all/--auto,-r/--remove,-g/--gui,-u/--update), case-insensitive matching, unknown-flag handlingREGEXpattern: validates numeric menu choice filtering (^[0-9]+$)runAuto(): copiesscriptmodules/tree to$RP_EXTRA, creates target dir, preserves content, overwrites on re-runremoveAll(): removes$RP_EXTRA, handles missing-dir error pathcopyModule(section/name.sh): creates section dir, copies script + companion data directory when present, skips data dir when absentdeleteModule(section/name.sh): removes script + data dir, cascading cleanup of empty section → scriptmodules → RP_EXTRA dirsstartCmd(): validates$RPS_HOMEexistsrunAuto→removeAll,copyModule→deleteModulewith and without data dirstests/scriptmodule_validation.bats(40 tests)Validates all 234 scriptmodule
.shfiles:rp_module_id,rp_module_desc,rp_module_section), non-empty values, valid section valuesrp_module_idvalues across all scriptsbash -nsyntax check on all scripts +install-extras.shDocuments pre-existing repo issues as tracked "known issue" tests:
golang-1.17.sh: missing shebanglr-bsnes-jg.sh,lr-gearcoleco.sh,lr-bsnes-hd.sh: bash syntax errorssupermodel/,openxcom/: shared data dirs used by differently-named scriptstests/wrapper_scripts.bats(18 tests)Validates
remove-extras.sh,update-extras.shstructure and delegation, plusinstall-extras.shfunction definitions and entry point.Running
Link to Devin session: https://app.devin.ai/sessions/5d99affc9f404dd39ee9e5eb997160a4
Requested by: @Exarkuniv