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

[Sketch] Support other testing frameworks #11

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DrJosh9000
Copy link
Contributor

Description

Code I started writing in today's meeting, for future reference (not necessarily intended to be exactly how it should be done)

Context

  • We need to handle other testing frameworks.
  • We need a strategy for passing huge lists of test cases/files to test-running commands (such as rspec) or at least be able to handle that particular error from Run.

Changes

  • Introduce an interface with the three runner methods called by main
  • Introduce a flag to switch between runner types
  • Add a check for syscall.E2BIG errors from cmd.Run (good) and recursively split the test cases in half (maybe not so good)

Testing

Not tested at all - some of the code isn't bad, but it's intended as a demo.

This is not an ideal solution: we can probably figure out the limit in advance and then chunk the test cases once, rather than making slices repeatedly while recursing and hitting the same E2BIG errno repeatedly.
This uses an anonymous interface type to define the set of methods needed on the testRunner by main, and introduces a flag as a way to specify the framework type.

Aside from the `GoTests` being an empty example, note that there's no environment var that corresponds to the new flag, and there are no flags corresponding to the config currently specified by env var... unifying these might be nice?
Copy link

linear bot commented Feb 6, 2024

PIE-2314 Sketch of support for different testing frameworks/languages

The problem

"How to architect the go client in a way that we could easily extend its functionality to include other test runners is other languages and testing frameworks?"

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

1 participant