Repository navigation
sm-git: add smrunner tests for the natives and git-admin - #1
Merged
Merged
Conversation
The unit tests cover the extension's core, but nothing checked the natives as a plugin calls them, against a real remote: cloning, reading, the write-out rules, watches, removal and the argument checks, nor the sm_git command. Under smrunner they now run on every push against the packed extension and plugin with both runners, and a failure blocks the release. The tests clone this repository from GitHub, so they need the network. They read two fixed revisions: v1.0.0 and the tag smrunner-fixture, which points at this commit, so the log, diffs and WriteDir's deletions have a second commit that never moves. The lint job also checks tests/ and runs pawntidy. Assisted-By: anthropic/claude-opus-5-5
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.
Adds SourcePawn tests that run under smrunner, plus their CI wiring.
tests/test_git.sp(22 tests) covers:clone = false, URL normalization and every URL rule (Git_Refused), and fetch;Resolve,ListRefs,Logwith a path andsince,Diff(added, modified, deleted, sorted, with a path) andListTree(recursive, top only, a subdirectory, sizes, SHAs, the executable bit);ReadFilewithmaxBytes,WriteFile(written only when the content differs, changes also on failure), and refusals for the root and.git-tmpnames;WriteDirwith and withoutoldRev, andCompareFile(same, different, missing);Git_ListRepositorieswith its openers and watchers, andRemovewhile the repository is open or watched;tests/test_git_admin.sp(11 tests) coverssm_gitclone, list, status, log, fetch and remove, the hints and usage text, and the root flag.https://github.com/ETF2L/sm-gitinto its own root, so the tests need the network. They read two fixed revisions:v1.0.0;smrunner-fixture, which points at this PR's commit (82602e6). It givesLog,DiffandWriteDir's deletions a second revision that never moves, and keeps that commit reachable after a squash merge. Keep both tags where they are.stage/(extension,git-admin.smx,ca-bundle.crtvia--file) withsmrunnerandsmrunner64, usingdavenonymous/sm-runner/setup@v0andtest@v0, before the archive upload. A failure also blocks the release.tests/and runs pawntidy.scripting/already passes it unchanged.tests/.Checked locally with smrunner v0.1.0 against the v1.0.0 release (the same extension code): 22/22 and 11/11 on both runners, and lint is clean.