Skip to content

Harden runner edge cases#113

Open
ShiroKSH wants to merge 2 commits into
CFC-Servers:mainfrom
ShiroKSH:fix/runner-edge-cases
Open

Harden runner edge cases#113
ShiroKSH wants to merge 2 commits into
CFC-Servers:mainfrom
ShiroKSH:fix/runner-edge-cases

Conversation

@ShiroKSH

@ShiroKSH ShiroKSH commented Jul 8, 2026

Copy link
Copy Markdown

Summary

  • Record setup failures as test failures instead of letting the runner abort or leave test environments mutated.
  • Avoid duplicate async results, preserve runner order across files, and reset accumulated results between runs.
  • Tighten expectation and loader edge cases, including shared client tests and include-error reporting.
  • Fix stale Docker/docs examples that pointed at the wrong artifact layout or obsolete settings.

Testing

  • git diff --check
  • Checked new GLua self-test files for trailing whitespace, conflict markers, and tabs.

@ShiroKSH
ShiroKSH marked this pull request as ready for review July 8, 2026 16:59
@ShiroKSH

Copy link
Copy Markdown
Author

@sarahsturgeon - could you take a look at the runner edge-case hardening in this PR when you have a chance, or route it to the right reviewer? I can make any requested changes or add tests. Thanks!

@ShiroKSH

Copy link
Copy Markdown
Author

@sarahsturgeon Friendly reminder: we'd appreciate it if you could take a look at this pull request when you have a chance.

@A1steaksa A1steaksa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem like good changes. There are a few small things I've noted, but generally I think this is an improvement.

Thanks for taking the time to contribute to GLuaTest!


cases = {
{
name = "Records sync beforeEach errors as failures",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Case name is difficult to understand unless you already know what the case is and does

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed this case to make the expected behavior explicit: Fails the case when beforeEach errors. See lua/tests/gluatest/runner/test_case_runner.lua in efd921b.

end
},
{
name = "Records async beforeEach errors as failures",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Case name is difficult to understand unless you already know what the case is and does

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed this case to make the async behavior explicit: Fails the async case when beforeEach errors. See lua/tests/gluatest/runner/test_case_runner.lua in efd921b.

name = "Sends shared cases when the gluatest_client_enable ConVar is enabled",
func = function( state )
local Loader = state.Loader
state.currentRunClientside = GLuaTest.RunClientsideConVar:GetBool()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This variable stores the prior RunClientsideConVar value, not the current value

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed state.currentRunClientside to state.previousRunClientside throughout the loader self-test file in efd921b.

Comment thread lua/gluatest/expectations/negative.lua Outdated
assert( TypeID( subject ) == TYPE_FUNCTION, ".succeed expects a function" )

local success = pcall( subject, unpack( args ) )
local success = pcall( subject, unpack( args, 1, args.n ) )

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These additions to unpack throughout the PR strike me as unnecessary, given that the defaults for unpack should produce these same results

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the unpack arity change and dropped the trailing-nil self-tests in efd921b.

Comment thread lua/gluatest/expectations/negative.lua Outdated

if success == true then
i.expected( "to error" )
return

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if condition should be inverted to remove the case that just calls return to remove the "empty" code path

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inverted the branch so errWith only handles the failing call path; successful calls now fall through in efd921b.

@ShiroKSH
ShiroKSH requested a review from A1steaksa July 15, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants