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

include unittest into common #3168

Merged
merged 1 commit into from
Sep 13, 2017
Merged

include unittest into common #3168

merged 1 commit into from
Sep 13, 2017

Conversation

LFSaw
Copy link
Member

@LFSaw LFSaw commented Sep 6, 2017

Problem

Since a while, SuperCollider development increasingly relies on UnitTests to secure code stability.
Most prominently, they are part of the testing framework around travis.

Not having UnitTesting capabilities in the core library makes the development process rely on a Quark extension. This seems to place it out of sight of developers.

Changes

To ease the process of UnitTesting and to encourage people to write UnitTests, I propose to include the UnitTest framework (UnitTest, UnitTestResult, UnitTestScript) into the main repository. This will also ensure that travis builds always use the right UnitTest framework for their tests.

I copied the classes defined in the UnitTesting quark to SCClassLibrary/Common/UnitTesting and added the tests to testsuite/classlibrary resp. testsuite/classlibrary/server (server-related tests, according to #3161 ). Help files went to HelpSource.

To Do

  • clarify the use of MixedBundleTester. It is an extension that might be useful for testing Bundles, however, there is no helpfile available, sourcecode documentation is sparse. Maybe @crucialfelix can shed some light?

Related

@LFSaw LFSaw added comp: UnitTest enhancement good first issue indicates issue tickets that are suitable for a new contributor labels Sep 6, 2017
@LFSaw LFSaw self-assigned this Sep 6, 2017
@LFSaw
Copy link
Member Author

LFSaw commented Sep 6, 2017

@danstowell @crucialfelix @telephon — as the original authors (according to the quarks file), maybe you want to comment / claim authorship?

@danstowell
Copy link
Member

I didn't invent the class, possibly crucial did, though I did a fair amount of work with it. The proposal sounds OK to me.

@@ -0,0 +1,56 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these unit tests should go into testsuite, shouldn't they?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm, aren't they? filename reads testsuite/classlibrary/TestUnitTest.sc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could swear they read something else :)

@adcxyz
Copy link
Contributor

adcxyz commented Sep 7, 2017

I propose to include the UnitTest framework (UnitTest, UnitTestResult, UnitTestScript) into the main repository. This will also ensure that travis builds always use the right UnitTest framework for their tests.

agreed!
That also encourages people to write UnitTests for their own quarks.
Object-test.sc as a shortcut could also go in SCClassLibrary.

TestMixedBundle should be reviewed and added to testsuite/classlibrary,
it seems to overlap somewhat with TestServer.sc
2c adc

@nhthn
Copy link
Contributor

nhthn commented Sep 8, 2017

can we make this master instead of 3.9?

@LFSaw
Copy link
Member Author

LFSaw commented Sep 8, 2017

why?

@nhthn
Copy link
Contributor

nhthn commented Sep 9, 2017

never mind, i was convinced at the dev meeting that 3.9 is fine

@nhthn nhthn added this to the 3.9 milestone Sep 9, 2017
@crucialfelix
Copy link
Member

MixedBundleTester is for testing MixedBundle (as one might expect) which is used by JITlib and crucial library and a few others.

https://github.com/search?l=SuperCollider&q=MixedBundleTester&type=Code&utf8=%E2%9C%93

https://github.com/search?l=SuperCollider&q=MixedBundle&type=Code&utf8=%E2%9C%93

It is just like an OSCBundle but it also has event handlers. It executes functions at send time. That is why it is called "mixed" - I forget who named it that.

I wouldn't bother to remove it as it does no harm and would causes significantly more work (with no gain) if you removed MixedBundle functionality. Basically it would break things permanently (again, with no actual gain).

@crucialfelix
Copy link
Member

TestMixedBundle should be reviewed and added to testsuite/classlibrary,
it seems to overlap somewhat with TestServer.sc

Not really. It tests that MixedBundle does what it says on the package. All unit tests test a unit - a single class - and ensure that it works as advertised.

@telephon telephon merged commit d88ee0f into supercollider:3.9 Sep 13, 2017
@mossheim
Copy link
Contributor

mossheim commented Oct 1, 2017

Just to make sure I'm not going crazy... this PR didn't actually put UnitTest in the class library, did it? It still has to be acquired via Quarks afaict.

@mossheim
Copy link
Contributor

mossheim commented Oct 1, 2017

The PR description says

I copied the classes defined in the UnitTesting quark to SCClassLibrary/Common/UnitTesting

but no such directory exists....

@LFSaw
Copy link
Member Author

LFSaw commented Oct 1, 2017

sorry, there was a hickup in my git commiting for this branch...

the branch that was merged now has it. 6b034df

@mossheim
Copy link
Contributor

mossheim commented Oct 1, 2017

@LFSaw where/when was that merged? is it in develop only?

@mossheim
Copy link
Contributor

mossheim commented Oct 1, 2017

never mind, i see it now, sorry. (on mobile)

@mossheim
Copy link
Contributor

mossheim commented Oct 1, 2017

it takes more work than just including the files, because of Travis config. do you mind if i go ahead with #3218

@LFSaw
Copy link
Member Author

LFSaw commented Oct 1, 2017

go ahead. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue indicates issue tickets that are suitable for a new contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants