cltk icon indicating copy to clipboard operation
cltk copied to clipboard

Speed up WordNet tests and/or move to unit tests

Open kylepjohnson opened this issue 4 years ago • 5 comments

I'm working on speeding up the testing process by breaking tests into two stages:

  • doctests, which should build fast-ish
  • unit tests, which contain slow-to-run tests

Since wordnet makes remote calls (and because it is so thoroughly covered -- good!), it takes ~5 mins to run.

I propose that you guys work on one or more of the following:

  • refactoring the many little doctests (example) and moving them "up" into the class docstring. Would doing this reduce the number of remote calls you'd need to make?
  • If the cannot be sped up with the above, them move most to a module tests/test_wordnet.py. These we'll as a more thorough "integration" test which we may or may not need during day-to-day development. In these, I really don't care about speed at all!

cltk/cltkv1#68

kylepjohnson avatar Jun 23 '20 21:06 kylepjohnson

Elsewhere I have been able to keep doctests in place, but skip them when they take too long (e.g. see https://github.com/todd-cook/ML-You-Can-Use/blob/master/mlyoucanuse/bert_fun.py#L45 ) This would allow us to keep tests in place for documentation continuity, and also place some in the integration test (without the skip switch). I'll profile the tests and see if there are any hotspots or places we can aggregate for a win.

todd-cook avatar Jun 23 '20 22:06 todd-cook

# doctest: +SKIP -- this would work too

kylepjohnson avatar Jun 23 '20 22:06 kylepjohnson

Is there a task I can take on without interfering with Todd's work on the tests? Todd you had mentioned some issues with the tests relating to the API -- shall I focus on these?

wmshort avatar Jun 25 '20 11:06 wmshort

Yes, please look into those issues. If there are changes to be made, I'll be able to move things around, and nothing will get lost.

On Thu, Jun 25, 2020 at 4:22 AM William Michael Short < [email protected]> wrote:

Is there a task I can take on without interfering with Todd's work on the tests? Todd you had mentioned some issues with the tests relating to the API -- shall I focus on these?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/cltk/cltkv1/issues/70#issuecomment-649479128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFCOLLHDVBS33EEIEPTKBDRYMXPLANCNFSM4OGBH2XA .

todd-cook avatar Jun 25 '20 14:06 todd-cook

OK, perfect, I will get that done tonight or tomorrow morning! Thanks for all your help

William Michael Short Lecturer in Classics & Ancient History University of Exeter Phone: 01392 724794 E-mail: [email protected] Amory Building, Rennes Drive, Exeter, Devon, EX4 4RJ Ancient Greek WordNethttps://greekwordnet.chs.harvard.edu/ | Latin WordNethttps://latinwordnet.exeter.ac.uk/ | Cylleneus: Next-gen corpus search for ancient languageshttps://github.com/cylleneus [http://www.exeter.ac.uk/codebox/email-sig/staff-sig.gif] This email and any attachment may contain information that is confidential, privileged, or subject to copyright, and which may be exempt from disclosure under applicable legislation. It is intended for the addressee only. If you received this message in error, please let me know and delete the email and any attachments immediately. The University will not accept responsibility for the accuracy/completeness of this email and its attachments.

From: Todd Cook [email protected] Sent: 25 June 2020 15:50 To: cltk/cltkv1 [email protected] Cc: Short, William Michael [email protected]; Assign [email protected] Subject: Re: [cltk/cltkv1] Speed up WordNet tests and/or move to unit tests (#70)

CAUTION: This email originated from outside of the organisation. Do not click links or open attachments unless you recognise the sender and know the content is safe.

Yes, please look into those issues. If there are changes to be made, I'll be able to move things around, and nothing will get lost.

On Thu, Jun 25, 2020 at 4:22 AM William Michael Short < [email protected]mailto:[email protected]> wrote:

Is there a task I can take on without interfering with Todd's work on the tests? Todd you had mentioned some issues with the tests relating to the API -- shall I focus on these?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/cltk/cltkv1/issues/70#issuecomment-649479128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFCOLLHDVBS33EEIEPTKBDRYMXPLANCNFSM4OGBH2XA .

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcltk%2Fcltkv1%2Fissues%2F70%23issuecomment-649597764&data=02%7C01%7CW.Short%40exeter.ac.uk%7Cf65f2680708548adf22408d819172167%7C912a5d77fb984eeeaf321334d8f04a53%7C0%7C0%7C637286934426456316&sdata=vaBDmvwZbCec0TjwqllP4RWJvnSZaatPvzi92IW7oQM%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAIWMJIXNEHQYKLF7PBQ6WDDRYNP2LANCNFSM4OGBH2XA&data=02%7C01%7CW.Short%40exeter.ac.uk%7Cf65f2680708548adf22408d819172167%7C912a5d77fb984eeeaf321334d8f04a53%7C0%7C0%7C637286934426466273&sdata=fJwcHtZAC85VBgOD6g%2F3WhagvXJeEq7KgMBjuCSb77I%3D&reserved=0.

wmshort avatar Jun 25 '20 15:06 wmshort