Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: simplify tests for api.Generate #3031

Merged
merged 2 commits into from
May 1, 2024

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented Apr 30, 2024

The PR refactor tests for the api.Generate function. Changes:

  • Remove generated files graph/generated.go, graph/federation.go. These files are re-generated on every test run.
  • Use path/filepath instead of path because filepath uses either forward slashes or backslashes, depending on the operating system.
  • Remove redundant args struct.
  • Handle errors from os.Getwd and os.Chdir.
  • Remove wantErr struct field because it's always nil.
  • Use T.Cleanup instead of defer func.

@alexandear alexandear changed the title refactor: simplify tests for Generate refactor: simplify tests for api.Generate Apr 30, 2024
@coveralls
Copy link

coveralls commented Apr 30, 2024

Coverage Status

coverage: 75.167% (-0.03%) from 75.198%
when pulling 72bba78 on alexandear:refactor/test-generate
into 28405ac on 99designs:master.

Signed-off-by: Steve Coffman <steve@khanacademy.org>
@StevenACoffman StevenACoffman merged commit 9e8e7ed into 99designs:master May 1, 2024
17 checks passed
@StevenACoffman
Copy link
Collaborator

Hey thanks! I added the removed files to the .gitignore or people will constantly just be adding them back (even though the cleanup is supposed to delete them, it just happens).

@alexandear alexandear deleted the refactor/test-generate branch June 13, 2024 10:58
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.

None yet

3 participants