78 Commits

Author SHA1 Message Date
Jesse Gibson
b26ecab39e 0.4.0 v0.4.0 2016-09-27 14:07:17 -06:00
Jesse Gibson
e72ce823d6 Merge pull request #8 from PsychoLlama/greenkeeper-panic-client-0.3.0
Update panic-client to version 0.3.0 🚀
2016-09-27 13:04:29 -07:00
greenkeeperio-bot
f36e7f50d2 chore(package): update panic-client to version 0.3.0
https://greenkeeper.io/
2016-09-27 12:41:10 -07:00
Jesse Gibson
0cfd4a7671 Merge branch 'master' of https://github.com/PsychoLlama/panic-server 2016-08-13 09:42:27 -06:00
Jesse Gibson
0d7c3b06e9 Add logo for readme
Cool logo/image from Alvaro (soon to link to the new website!). Updated
readme to reflect the direction a bit better...
2016-08-13 09:40:28 -06:00
Jesse Gibson
497c69701e Merge pull request #7 from PsychoLlama/greenkeeper-mocha-3.0.1
Update mocha to version 3.0.1 🚀
2016-08-04 17:18:28 -07:00
greenkeeperio-bot
25b87cb939 chore(package): update mocha to version 3.0.1
https://greenkeeper.io/
2016-08-04 00:43:25 -07:00
Jesse Gibson
3554a7c6db Merge pull request #5 from PsychoLlama/greenkeeper-eslint-3.0.1
Update eslint to version 3.0.1 🚀
2016-07-05 22:46:38 -06:00
Jesse Gibson
6c1fcd1a2e Lint code on npm test
A new npm script has been added, `lint`, which is triggered on the test
command after unit tests pass.
This way, greenkeeper can update lint-related deps and know if it
breaks.
2016-07-05 22:41:02 -06:00
greenkeeperio-bot
a0be6e1e1b chore(package): update eslint to version 3.0.1
https://greenkeeper.io/
2016-07-05 12:26:13 -06:00
Jesse Gibson
8364bf6e58 Merge pull request #3 from PsychoLlama/develop
Develop
2016-05-28 22:54:52 -06:00
Jesse Gibson
ebfced632f Merge branch 'develop' of https://github.com/PsychoLlama/panic-server into develop 2016-05-28 22:43:09 -06:00
Jesse Gibson
0ad6b4b8d3 Upgrade to panic-client v0.2.0, update docs.
Panic-client 0.2 comes with some great new improvements, like supporting back through IE6, making async functions more brief, and preventing implicit
scope injection except under a new flag, '@scope'. This commit updates
the docs to reflect the changes from panic-client, and updates the
client version dependency.
2016-05-28 22:31:39 -06:00
Jesse Gibson
7425aaac2d Rename .len() to .length, allow subclassing, export client bundle.
Instead of calling a method to find the length of a list, you can use a
property (which is a getter under the hood, doing the same thing as
`.len()`). This is cleaner and more intuitive, aligning itself more with
arrays.
Subclassing is now facilitated by a new method, `.chain`. It creates a
new list instance by calling the constructor property, instead of
statically creating a new ClientList instance. This allows you to
create subclasses that inherit from ClientList, without losing that
inheritance when calling `.filter` or `.pluck` (methods which create new
list instances).
The client bundle is now exported lazily, so when you import panic,
there's a `client` getter which memoizes a fs call for the client code.
This allows compatibility on pre-3.0 versions of npm, where other packages
might not be able to recursively find `panic-client`. Also, since it's a
getter, it doesn't do the file system call until it's needed.
2016-05-28 21:16:23 -06:00
Jesse Gibson
1e1eeb118b Rename .len() to .length, allow subclassing, export client bundle.
Instead of calling a method to find the length of a list, you can use a
property (which is a getter under the hood, doing the same thing as
`.len()`). This is cleaner and more intuitive, aligning itself more with
arrays.
Subclassing is now facilitated by a new method, `.chain`. It creates a
new list instance by calling the constructor property, instead of
statically creating a new ClientList instance. This allows you to
create subclasses that inherit from ClientList, without losing that
inheritance when calling `.filter` or `.pluck` (methods which create new
list instances).
The client bundle is now exported lazily, so when you import panic,
there's a `client` getter which memoizes a fs call for the client code.
This allows compatibility on pre-3.0 versions of npm, where other packages
might not be able to recursively find `panic-client`. Also, since it's a
getter, it doesn't do the file system call until it's needed.
2016-05-27 16:07:09 -06:00
Jesse Gibson
fa2da9920c Fix ClientList constructor property
Previously, since it wasn't explicitly set, it was referring to the
EventEmitter constructor.
2016-05-05 10:48:42 -06:00
Jesse Gibson
5bc03a2047 Don't extend Function.prototype
Instead of extending the Function's prototype with the `toJSON()`
method, since the `v0.1.0` refactor all functions have a narrow entry
point, meaning you can simply call `String(callback)`. The prototype is
no longer extended. Changelog and package.json updated.
2016-05-03 12:28:00 -06:00
Jesse Gibson
9a4c36a7b8 Added short section on using co.js
In the async/await section, it wouldn't have been the same without
mentioning our supreme leader Tj Holowaychuk and his co js library.
Basically a syntax sugar using generators over promises. Added a short
demo of how to use it with panic.
2016-05-02 15:33:23 -06:00
Jesse Gibson
b18bbc6071 Merge pull request #2 from PsychoLlama/number-constraint-filter
Add client max method, fix `.excluding` bugs
2016-05-02 15:19:39 -06:00
Jesse Gibson
e7eea4286a Add client max method, fix .excluding bugs
There's a new method called `.pluck` that limits a list's length,
allowing you to arbitrarily pick out clients and select them for tasks.
The version has been bumped, changelog updated and readme modified.
Also, the `.excluding` method wasn't reactively checking to see if the
exclusion set was reduced, only added to. All tests passing.
2016-05-02 15:12:25 -06:00
Jesse Gibson
1f3586eba8 Merge pull request #4 from PsychoLlama/create-merged-list
Expose the ClientList, add super list feature
2016-05-02 12:50:33 -06:00
Jesse Gibson
5a6738bd7f Expose the ClientList, add super list feature
The `panic` object has a new property, `ClientList`, that allows users
to create their own lists easily. It brings in a new feature: you can
pass subgroups into the constructor as an array and it'll source it's
clients from them, allowing groups to be created from smaller
ones. Readme, changelog, npm version, and tests updated.
2016-05-02 12:46:13 -06:00
Jesse Gibson
05ddb23631 Fix documentation mistakes, remove duplicate examples
An example showing how to import code was showing the root route, which
has been deprecated in favor of /panic.js. Some examples were
duplicated, such as how to import client code. Now one simply links to
the other.
2016-05-02 11:28:06 -06:00
Jesse Gibson
e1ce854a9c Allow sharing of http.Server instances
`panic.serve` has been replaced with `panic.server`, which accepts
`http.Server` instances instead of options and always returns the
instance. This allows you to run one server and share it, instead of
creating one for each task. Also added a changelog to keep track of...
changes.

Breaks compatibility with `panic.serve`.
2016-05-01 13:55:15 -06:00
Jesse Gibson
d67425fe1a Merge branch 'master' of https://github.com/gundb/panic-server 2016-04-29 18:13:27 -06:00
Jesse Gibson
d031123e29 Add panic-client dep@latest 2016-04-29 18:12:43 -06:00
Jesse Gibson
5feeecd80b Merge branch 'simplify' 2016-04-29 17:50:56 -06:00
Jesse Gibson
0d6faa111e Merge pull request #3 from PsychoLlama/simplify
Simplify
2016-04-29 17:49:36 -06:00
Jesse Gibson
bfcd2df572 Bump minor version, remove .set[deprecated]
The version has hit it's first ever 0.1.0, and that comes with the
change of removing `.set()` entirely, since scope is now passed with the
function that uses it in `.run()`.
2016-04-29 17:22:10 -06:00
Jesse Gibson
4c50671892 Add shields.io badges, bump minor version, fix require path. 2016-04-29 15:29:01 -06:00
Jesse Gibson
f2b9332fa3 Merge pull request #1 from PsychoLlama/simplify
Simplify
2016-04-29 15:11:12 -06:00
Jesse Gibson
6e9163c2dc Minor docs refactor 2016-04-29 15:09:06 -06:00
Jesse Gibson
6f9ebab74b Add extensive documentation on all methods.
Every method exposed through the clientList (except .set[deprecated])
has been thoroughly documented in the readme.md file.
2016-04-29 14:55:58 -06:00
Jesse Gibson
1e95482b34 Add scope controls, loosely type check platform queries.
All tests passing.

Added a new keyword (cross-platform) to the package.json file.

Optionally, scope variables can be sent to the clients in the `.run`
method.

Platform queries are now loosely type checked. This allows you to match
a number against a string (or vice versa), such as a version or
architecture.
2016-04-29 13:05:49 -06:00
Jesse Gibson
72aa80d9bd Ignore all notes. 2016-04-27 18:32:47 -06:00
Jesse Gibson
46a4be5529 Remove notes, serialize functions properly, add data method.
Notes don't belong in core. Not sure why I included them :(

Functions are now toString'd when toJSON is called, allowing them to be
sent over the wire.

The new data method for clients is meant to set environment variables.
Send in the name of the scope and it will be merged in. This API may
change later to allow brevity.
2016-04-27 16:44:11 -06:00
Jesse Gibson
4edd691277 Customized eslint, use mocha instead, implement client
filters/exclusions, all tests passing.

Eslint came with these nasty notions about alphabetizing your variable
definitions. Strict enforcement has been enabled, and empty functions
are now allowed (noop, and it was causing noise while developing).

The tests are now using mocha instead of jasmine, as I'm trying to
become more familiar with it.

The clientList is now dynamically controlled. Only connected peers are
shown, and add/remove events are fired as things change. You can now
filter a client set against criteria (platform, generic callback) and
return a new list of live updating clients, subscribed to changes on the
parent list. There's some syntax sugar also. You can create a list that
excludes another set, such as a list of browsers might be everything
that isn't a Node.js platform. You'd write that as an exclusion.

Added some basic tests for the clientList and mock logic.
2016-04-27 09:59:02 -06:00
Jesse Gibson
c046b7e209 Remove all code, prep for redesign. 2016-04-26 14:44:34 -06:00
Jesse Gibson
734eabe816 Non-working commit (before major changes) 2016-04-26 12:34:09 -06:00
Jesse Gibson
5fc6cd5968 Remove panic bin, bump version
When the cli was moved into a different repo, the package.json file was
never updated, causing an install failure when looking for the panic
binary entry.
2016-04-01 15:15:22 -06:00
Jesse Gibson
61dd950a70 Prep package.json for publishing
Move version to smallest possible, change the name to panic-server since
it isn't taken, change the github links to the gundb repositories.
2016-04-01 15:00:18 -06:00
Jesse Gibson
aab9fdc71c Add "just" method
Experimental client filtering feature.
2016-04-01 13:20:30 -06:00
Jesse Gibson
1578d294c6 Merge gather with stage event, fix nomenclature, remove reporters
The gather method is now reactive with the "stage" event, so it won't execute and prematurely begin the test. The "needs" method now uses gather internally and decides when to `run`.

The "peer-done" event didn't make much sense for a centralized configuration, so it's been changed to "client-done".

Since the reporters have been moved out into the panic-cli repo, they've been removed from panic-server.
2016-03-31 18:09:35 -06:00
Jesse Gibson
6f71688ef7 Only emit stack "finished" when all tests terminate. 2016-03-31 17:42:07 -06:00
Jesse Gibson
5cf1290190 Fix failing tests
A beforeEach was setting up a fake test, and it didn't include the
`emit` method expected by `stack.js`.
2016-03-29 20:55:25 -06:00
Jesse Gibson
6cb737ebcc Filter clients on the server, save test results, isolate test controls.
Platform details are now sent to the server. If there are no stage listeners, it automatically sends the test to all the connected clients without being picky. This will allow extensions to filter out clients that don't match the criteria.

The results of every test are saved into a list of responses, each scoped to their test.

Instead of the stack deciding which clients get the test, that's been delegated to the test instances.
2016-03-29 20:51:06 -06:00
Jesse Gibson
b5ae660842 Client management tooling, cl interface prototype, tests refactored/passing
The test objects and the server now use `ClientList` to contain, track, and interact with lists of socket clients.

The test constructor now has a `toJSON` method that prevents conversion of circular structures and unecessary data transfer to the clients. It also ensures that only connected clients are stored at any time, and deleted when they disconnect, emitting the `remove` event.

Hacked-out terminal interface now allows for running test files outside the panic project folder, and testing the full integration of the suite, as well as ensuring that I'm taking this in the right direction.

Most of the tests were from an age where I didn't understand how to unit test. They assumed too much about the implementation. But now I'm reformed! They've been refactored to be less obtrusive.
2016-03-25 15:16:30 -06:00
Jesse Gibson
32f5c00d31 Add async done events, multi-test handlers, test run/end methods, client managers, tests failing.
Each test now tracks each peer that runs it, and can dig into the server clients to see if they're still connected. As clients report that they're done, it trickles into the test and it'll match it against the number of registered runners to see if it's all finished.

The stack now has a primitive method of pushing out the next test when it's ready, so you can write multiple tests and they'll run one after the other.

Tests now have a run and end method that allow you to easily tell the test when is appropriate to begin and when it should officially end and send control to the next test.

The tests are now notified when clients join and finish.

Sadly, the tests are still failing :(
2016-03-23 21:26:55 -06:00
Jesse Gibson
72194fec24 Merge branch 'master' of https://github.com/gundb/panic-server 2016-03-23 14:00:13 -06:00
Jesse Gibson
18a2b1f43d Implement basic async client/server discourse model
End-to-end integration with the client, where the client connects, recieves a test, it will later respond when it's ready, then the server responds when it is ready. Then each peer will run the test and report back to the original test object.
2016-03-21 19:38:15 -06:00