Skip to content

Assert what github_graph actually returns - #676

Open
Thayorns wants to merge 3 commits into
zerocracy:masterfrom
Thayorns:665
Open

Assert what github_graph actually returns#676
Thayorns wants to merge 3 commits into
zerocracy:masterfrom
Thayorns:665

Conversation

@Thayorns

@Thayorns Thayorns commented Sep 2, 2026

Copy link
Copy Markdown

test_simple_use and test_use_with_global_variables called Fbe.github_graph and stopped, never looking at what came back. Both stayed green whether the factory returned Fbe::Graph::Fake, a real client, or nil, so the one place where testing mode could accidentally reach the live API had no assertion guarding it.

test_simple_use now checks the fake is returned when testing is on, and a companion test covers the other branch of the same decision, where testing is not set and a real Fbe::Graph is built instead. A third checks that testing wins over a github_token when both are given, which is the combination a judge run actually hands over.

Three more cover the memoization the factory does through global[:github_graph]: the same object comes back on a second call inside one global, a second global gets its own object, and the same holds on the path that reads the global variables. That last one sets and clears $global, $options and $loog itself rather than leaning on test_use_with_global_variables, which now owns that cleanup.

Closes #665

@yegor256 please take a look

@Thayorns

Thayorns commented Sep 2, 2026

Copy link
Copy Markdown
Author

@yegor256 please take a look, happy to clarify anything.

@Thayorns

Thayorns commented Sep 2, 2026

Copy link
Copy Markdown
Author

@yegor256 fixed here, take a look please

yegor256 commented Sep 3, 2026

Copy link
Copy Markdown
Member

This PR now has merge conflicts and needs a rebase before it can go in. Assigning to @yegor256 for a look.


Generated by Claude Code

@yegor256
yegor256 self-requested a review September 3, 2026 06:21
@Thayorns

Thayorns commented Sep 3, 2026

Copy link
Copy Markdown
Author

@yegor256 take a look please

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.

Two tests in test/fbe/test_github_graph.rb assert nothing

2 participants