Early draft of an API for interoperability of back-end components in test-frameworks

46 views
Skip to first unread message

Rasmus Schultz

unread,
Oct 23, 2018, 3:56:13 PM10/23/18
to PHP Framework Interoperability Group
Hey Figs,

I wrote an early draft of an API for interoperability of back-end components in test-frameworks.

That's kind of wordy, so for now I'm referring to this as "test-interop".

The draft and interfaces are here:

https://bitbucket.org/mindplaydk/test-interop/src/master/

The idea is to provide a simple kind of streaming message protocol for test-frameworks to back-end components, e.g. pretty-printers, reporters, etc.

For now, it's a few interfaces based on the semantics and properties of JUnit XML reports, which are fairly universal.

The interfaces can't really enforce call order, so for now, there's a mandate about dispatching messages chronologically, and for test-listeners to throw exceptions if messages arrive out of order. (It's not too shaky, but not exactly rock-solid, and I'm definitely open to ideas.)

Anyhow. Wondering if there's any interest in this?

Cheers,
  Rasmus

Larry Garfield

unread,
Oct 24, 2018, 2:13:00 PM10/24/18
to php...@googlegroups.com
Interesting concept. However, I'm not sure who the target audience is. Is
this something that would be helpful to the authors of PHPUnit/Mockery/etc?
Or to users writing tests using those? Or...?

It would need at least some buy-in from the target audience in order to
proceed. Eg, if Sebastian said he was in and interested, that would make it a
lot more reasonable.

(Are there test runners other than PHPUnit that anyone actually uses? Honest
question...)

--Larry Garfield
signature.asc

Rasmus Schultz

unread,
Oct 25, 2018, 4:51:31 AM10/25/18
to PHP Framework Interoperability Group
Yes, this would make it possible to share back-end components between test-frameworks - I believe the document explains as much?

And yes, some of us write tests and don't use PHPUnit.

The idea came about during some preliminary discussions with a collaborator about building a new test-framework - so we're doing this work either way, and it occurred to me this could be useful.

The Javascript testing ecosystem has more options besides a single, monolithic, proprietary test-framework - and is more modular. I've been using Tape, and being able to select components and build small, focused, modular test-suites is quite enjoyable.

Either way, whether we label this as a PSR, I'm mostly indifferent - we'll most likely offer the interfaces as a separate package and spec either way.

I figured something like this might help bring some of that modular joy to PHP, that's all :-)
Reply all
Reply to author
Forward
0 new messages