Re: Test suite for Activity Streams 2.0

Evan,

I took at quick look at the driver and it looks like a great start.
Just to throw some additional ideas into the pot, I took some time
yesterday to put together an alternative:
https://github.com/jasnell/asint

asint tests the JS activitystrea.ms impl by first performing a
roundtrip deserialization-serialization then applying a JSON Pointer
to select output.

So, for instance, if I have an input file test.json:

{
  "@context": [
    {"foo": "urn:foo:", "bar": "foo:bar"},
    "http://www.w3.org/ns/activitystreams#"
  ],
  "@id": "http://example.org/foo",
  "@type": "Like",
  "displayName": "I like this",
  "actor": {
    "@type": "Person",
    "displayName": "James"
  },
  "bar": 1
}

I can perform a number of inspections on the file:

$ asint -i test.json -p /@type
Like
$ asint -i test.json -p /displayName
I like this
$ asint -i test.json -p /actor/displayName
James
$ asint -i test.json -p /urn:foo:bar
1

By having the tool perform a full deser/ser roundtrip, we can make
sure that the input was understood correctly by the activitystrea.ms
JS implementation. The JSON Pointer used to interrogate is based on
the normalized, normative AS 2.0 @context so the results should be
predictable.

Thoughts?

- James

On Tue, Oct 13, 2015 at 1:49 AM, Evan Prodromou <evan@e14n.com> wrote:
> Christopher Webber and I and others have been discussing the best way to do
> a test suite for Activity Streams 2.0 (AS2). We've got an initial version
> here:
>
>     https://github.com/w3c-social/a2test
>
> The suite can test both AS2 consumer and producer implementations. It uses a
> simple command-line interface to give a simple cross-language testing
> framework. We considered using a Web interface but we decided that this
> would require too much setup to run a test, and would also delve into dicey
> territory around the Social API.
>
> There's a long README about the interface that I won't duplicate here.
>
>     https://github.com/w3c-social/a2test/blob/master/README.md
>
> I started work on testing wrappers for jasnell's awesome activitystreams.js
> library. The wrappers are here:
>
>     https://github.com/evanp/activitystreams.js-test
>
> As of right now, they pass the test suite. James, I'd be happy to see this
> merged into activitystreams.js or leave it separate if that's what you'd
> prefer.
>
> Cwebber is working on a Python library for AS2, visible here:
>
>     https://github.com/w3c-social/activipy
>
> I hope to see it passing the test suite soon!
>
> The test suite itself is the bare minimum needed to prove out the interface.
> We'll need to expand it significantly to cover all the examples in AS2 core
> and vocabulary, as well as edge cases and implied properties. But it's on
> the right track, I think.
>
> Thanks to everyone who offered suggestions. And please let us all know if
> you're implementing an AS 2.0 library and are going to use this test suite
> on it.
>
> -Evan
>
>

Received on Wednesday, 14 October 2015 16:04:16 UTC