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

server related tests? #7

Open
telephon opened this issue Jun 15, 2016 · 8 comments
Open

server related tests? #7

telephon opened this issue Jun 15, 2016 · 8 comments
Assignees

Comments

@telephon
Copy link
Contributor

Not sure how we should handle server related tests.

Here are doneAction tests, not yet in the form required. But where to put them?


(
SynthDef(\test_env_done_actions, { |doneAction, gate = 1|
    EnvGen.kr(Env.asr(0, 1, 0), gate,doneAction:doneAction)
}).add
)

// doneAction 0: do nothing when the UGen is finished

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 1], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying }




// doneAction 1: pause the enclosing synth, but do not free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 1], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying } and: { h.isRunning.not }



// doneAction 2: free the enclosing synth

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 2], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not }



// doneAction 3: free both this synth and the preceding node

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 3], g, \addAfter).register;
h.set(\gate, 0);
g.isPlaying.not and: { h.isPlaying.not }



// doneAction 4: free both this synth and the following node

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 4], g, \addBefore).register;
h.set(\gate, 0);
g.isPlaying.not and: { h.isPlaying.not }


// doneAction 5: free this synth; if the preceding node is a group then do g_freeAll on it, else free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 5], g, \addAfter).register;
z = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { z.isPlaying.not }


// doneAction 6: free this synth; if the following node is a group then do g_freeAll on it, else free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 6], g, \addBefore).register;
z = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { z.isPlaying.not }

// doneAction 7: free this synth and all preceding nodes in this group

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 7], g, \addToHead).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToTail).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { y.isPlaying } and: { x.isPlaying.not }


// doneAction 8: free this synth and all following nodes in this group

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 8], g, \addToHead).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToTail).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { x.isPlaying } and: { y.isPlaying.not }


// doneAction 9: free this synth and pause the preceding node

g = Group(s).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToTail).register;
y = Synth(\test_env_done_actions, [\doneAction, 9], g, \addToTail).register;
y.set(\gate, 0);
y.isPlaying.not and: { x.isRunning.not }



// doneAction 10: free this synth and pause the following node

g = Group(s).register;
x = Synth(\test_env_done_actions, [\doneAction, 10], g, \addToTail).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToTail).register;
x.set(\gate, 0);
x.isPlaying.not and: { y.isRunning.not }

// doneAction 11: free this synth and if the preceding node is a group then do g_deepFree on it, else free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 11], g, \addAfter).register;
z = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { z.isPlaying.not }


// doneAction 12: free this synth and if the following node is a group then do g_deepFree on it, else free it

g = Group(s).register;
h = Synth(\test_env_done_actions, [\doneAction, 12], g, \addBefore).register;
z = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { z.isPlaying.not }


// doneAction 13: free this synth and all other nodes in this group (before and after)

g = Group(s).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h = Synth(\test_env_done_actions, [\doneAction, 13], g, \addToHead).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying and: { h.isPlaying.not } and: { y.isPlaying.not } and: { x.isPlaying.not }


// doneAction 14: free the enclosing group and all nodes within it (including this synth)


g = Group(s).register;
x = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h = Synth(\test_env_done_actions, [\doneAction, 14], g, \addToHead).register;
y = Synth(\test_env_done_actions, [\doneAction, 0], g, \addToHead).register;
h.set(\gate, 0);
g.isPlaying.not and: { h.isPlaying.not } and: { y.isPlaying.not } and: { x.isPlaying.not }

@crucialfelix
Copy link
Contributor

It's been a long time, but in case this is of any use:
https://github.com/crucialfelix/CrucialTests/blob/master/TestAbstractPlayer.sc

There are all kinds of async tests in there, but it just uses this.wait

jasmine has async support:
http://jasmine.github.io/2.0/introduction.html#section-Asynchronous_Support

and I usually test javascript async stuff using promises. that is the fastest way, but sc has no promises.

@telephon
Copy link
Contributor Author

That's a good example.

I wondered because recently you said that the tests that require starting a server would slow down travis too much.

@crucialfelix
Copy link
Contributor

We should be polite and concerned. Also it seems crazy to run all of this every time someone changes a help file.

@telephon
Copy link
Contributor Author

Maybe we should add such tasks to a different quark which is only executed at royal occasions?

@crucialfelix
Copy link
Contributor

also: Commits that have [ci skip] anywhere in the commit messages are ignored by Travis CI.

@telephon
Copy link
Contributor Author

good to know.

@telephon telephon self-assigned this Jun 22, 2016
@scztt
Copy link

scztt commented Jun 23, 2016

Right now, server tests aren't run on travis, and won't be able to be run without some serious configuration work (either (1) get some kind of proxy jack daemons running on the travis machines, or (2) refactor server tests to also be usable in an NRT context - preferably 1 with some of 2). It's probably more worthwhile to get the tests actually running in the first place, rather than spending the time to plan around a problem that doesn't exist yet. We would be in FANTASTIC shape if we had enough unit tests that we actually had to worry about how long they took ....

@scztt
Copy link

scztt commented Jun 23, 2016

And, fyi, repackaging to a different quark isn't required to filter what's run on travis. The test suites run on ci builds is defined here: https://github.com/supercollider/supercollider/blob/master/travis_test_run_proto.json

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

No branches or pull requests

3 participants