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

Improve the way we're organizing operator tests #27

Closed
elboletaire opened this issue Nov 15, 2018 · 1 comment
Closed

Improve the way we're organizing operator tests #27

elboletaire opened this issue Nov 15, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@elboletaire
Copy link
Member

We now can test our operators, but using a single .json file which is huuuuge as soon as you add two or three tests.

We should find a way to organize these tests in separated files. As tests allow (or shall allow) running multiple tests for one operator, we should think in a way to sort them properly.

A part from splitting the .json file into independent files it may be very interesting to use yaml files instead of json, as they give us advantages like yaml templates which will allow us to reduce our operator test files.

refs #24

@elboletaire elboletaire added the enhancement New feature or request label Nov 15, 2018
elboletaire added a commit that referenced this issue Nov 15, 2018
elboletaire added a commit that referenced this issue Nov 23, 2018
Thanks to @AlexanderArce for his initial work on the tests :)

Squashed commit of the following:

commit aee75d2
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 16:23:10 2018 +0100

    Improved error message for HTTP plugin

commit 83895c4
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 16:22:52 2018 +0100

    Use yarn instead of npm for docker build (as we have a yarn.lock, not an npm-lockfile.json)

commit c5dd3be
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 14:15:40 2018 +0100

    Updated asciinema

commit ff6a63e
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 14:10:46 2018 +0100

    Also check demo operators with test-operators (only at gitlab.com)

commit cc88ae9
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 14:08:05 2018 +0100

    Minor package.json changes

commit fa43fda
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 14:07:27 2018 +0100

    Move operator files to `test/files` folder, so we can properly mount
    volumes with the generated docker image

commit 0e7736d
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 13:55:42 2018 +0100

    Removed unnecessary (commented) log

commit 6ef445f
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 13:53:24 2018 +0100

    Added optional descriptions to tests, and properly display them

commit bba516e
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 13:34:33 2018 +0100

    Finnally we can run multiple tests on the same operator !

commit 6044e0c
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 12:39:42 2018 +0100

    Standarized plugin debug & log messages (at least the ones from execute method)

commit d983eb6
Author: Òscar Casajuana <[email protected]>
Date:   Fri Nov 23 12:24:20 2018 +0100

    Now all plugins receive the message on execute, not on construct

commit 05ad689
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 22 17:57:24 2018 +0100

    We need the message in the constructor of the plugins (still moving
    things..)

commit 0ca6751
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 22 14:31:01 2018 +0100

    Minor readme change

commit a811fa2
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 22 11:15:03 2018 +0100

    Added injectResponse method to HTTP mock + other required changes

commit 6b38b24
Author: Òscar Casajuana <[email protected]>
Date:   Mon Nov 19 17:21:39 2018 +0100

    Just the operators-tester full of logs

commit 6c77ed3
Author: Òscar Casajuana <[email protected]>
Date:   Mon Nov 19 17:20:40 2018 +0100

    Upgraded all plugins left (dirty commit, still needs work)

commit 5d8849a
Author: Òscar Casajuana <[email protected]>
Date:   Mon Nov 19 14:29:40 2018 +0100

    Updated conditional and log plugins

commit 2c08500
Author: Òscar Casajuana <[email protected]>
Date:   Mon Nov 19 14:04:09 2018 +0100

    Fixed ExecutionPluginInterface options type

commit cd5a5e0
Author: Òscar Casajuana <[email protected]>
Date:   Mon Nov 19 13:38:48 2018 +0100

    Added ExecutionPluginInterface + already updated HTTP plugin

commit 09c7445
Author: Òscar Casajuana <[email protected]>
Date:   Mon Nov 19 13:00:13 2018 +0100

    Moving schemas to schemas folder

commit 6af24da
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 19:35:44 2018 +0100

    Adding testing yaml and json files (shall be removed once finished with

commit eeedc84
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 19:34:51 2018 +0100

    WIP: working on #27

commit f246989
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 19:08:52 2018 +0100

    Uncommented necessary log

commit fcdabef
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 19:07:02 2018 +0100

    yarn.lock file shouldn't have been removed

commit db194e7
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 19:05:45 2018 +0100

    Changed operators-tester message

commit 751fada
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 19:04:32 2018 +0100

    Added gitlab-ci badge

commit db0528b
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 19:04:18 2018 +0100

    Added missing test folder for jest

commit 59acba3
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 18:42:18 2018 +0100

    Removed dummy files

commit 37ca2fb
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 18:41:42 2018 +0100

    Removed erroneus trailing coma

commit ca9ef09
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 18:38:22 2018 +0100

    Removed unnecessary comment

commit 7f7c4c6
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 18:27:21 2018 +0100

    Fixed ActionCreator not throwing error when empty actions were passed

commit a7d68dc
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:58:01 2018 +0100

    Also add node 9 to travis tests

commit 89d661f
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:57:08 2018 +0100

    Think I found that unhandled promise..

commit 18b2f21
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:52:44 2018 +0100

    Trying to fix that unhandled promise rejection

commit 16eaf25
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:52:33 2018 +0100

    Fixed tests cannot be empty..

commit e8005b4
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:50:13 2018 +0100

    Ok... found it out.

commit cd2e52e
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:46:15 2018 +0100

    Well this starts to be awkward

commit 424bc94
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:40:53 2018 +0100

    Funny thing is that all of them work locally.. but fail on the CI
    servers..

commit a0a07e2
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:37:14 2018 +0100

    Fixed some async tests

commit 95bd587
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:33:47 2018 +0100

    Add --foceExit until supertest issue is resolved

    See ladjs/supertest#437

commit f19983d
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:32:15 2018 +0100

    Migrated remaining tests to jest + removed mocha, chai and other old
    dependencies

    refs #26

commit 2480b65
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:05:16 2018 +0100

    Trying to find out where open handles come from in cloud runners

commit f84f953
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 17:01:26 2018 +0100

    I said we dropped support for node 6...

commit c1179b8
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 16:59:39 2018 +0100

    Added .gitlab-ci.yml file

commit 68be252
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 16:51:53 2018 +0100

    Properly expose express server to close its connection

commit 24c6c7f
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 16:48:08 2018 +0100

    Drop support for node 6 and add support for node 10

commit 422be67
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 16:47:51 2018 +0100

    Update dockerfile maintainer label

commit 3989820
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 16:47:38 2018 +0100

    Ensure express closes its connection after ending tests

commit a7cf365
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 14:53:54 2018 +0100

    Fixed json syntax in readme file

commit 8b575df
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 14:29:18 2018 +0100

    Added asciinema of running test-operators

commit a49640d
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 14:14:28 2018 +0100

    Remove cfs from tasks' names

commit e7ce462
Author: Òscar Casajuana <[email protected]>
Date:   Thu Nov 15 14:13:49 2018 +0100

    Updated readme adding info about how to test operators

commit 9c52c54
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 12:34:01 2018 +0100

    Created new script for testing the operators called test-operators located in test/

commit eb55701
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 12:33:28 2018 +0100

    Moved operators-tester from src/ to test/

commit 57f2ae1
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:59:59 2018 +0100

    Now the operators-tester is empty

commit 9fb72f4
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:59:16 2018 +0100

    Fixed import

commit 88ca318
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:58:34 2018 +0100

    Renamed sbo-tester to operators-tester

commit 5ee189b
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:57:58 2018 +0100

    Added to the logger the colorize and enabled silent only for test ENV

commit 0572a32
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:57:22 2018 +0100

    Added event name

commit 418ebf0
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:56:07 2018 +0100

    Removed unused imports

commit 7db69d1
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:55:39 2018 +0100

    Moved PluginOptionsSchema to new file for testing

commit 8a0abc1
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:54:50 2018 +0100

    Added preLog to telegram and prev2task mocks

commit 8e00024
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:54:07 2018 +0100

    Created httpplugin mock

commit 8869d51
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 11:52:01 2018 +0100

    Due to changes in how files are readed we need to change imports

commit 0ddeebc
Author: Alexander Arce <[email protected]>
Date:   Thu Nov 15 12:05:25 2018 +0100

    Fixed conflict

commit 851412c
Author: Òscar Casajuana <[email protected]>
Date:   Wed Nov 14 17:21:55 2018 +0100

    Ensure TypeScript does not check included packages types (jest types
    have issues and make the build fail)

commit ebe1d1a
Author: Òscar Casajuana <[email protected]>
Date:   Wed Nov 14 17:21:22 2018 +0100

    Updating readme

commit ba6a58d
Author: Òscar Casajuana <[email protected]>
Date:   Wed Nov 14 12:13:48 2018 +0100

    Fixed OperatorsLoader.spec

commit 4491ba9
Author: Alexander Arce <[email protected]>
Date:   Wed Nov 14 09:26:00 2018 +0100

    Removed operator

commit 891096e
Author: Alexander Arce <[email protected]>
Date:   Tue Nov 13 17:08:53 2018 +0100

    Removed the slient from winston

commit 17af3be
Author: Alexander Arce <[email protected]>
Date:   Tue Nov 13 17:08:26 2018 +0100

    Removed comments, added an expect

commit d5b9e89
Author: Alexander Arce <[email protected]>
Date:   Tue Nov 13 17:07:37 2018 +0100

    Now the mocks are ES6 classes for using the constructor

commit 2030f60
Author: Alexander Arce <[email protected]>
Date:   Tue Nov 13 17:07:06 2018 +0100

    Added a string to copyEmail for testing

commit 6dd724b
Author: Òscar Casajuana <[email protected]>
Date:   Tue Nov 13 16:28:49 2018 +0100

    Adding fs __mock__ (dirty commit..)

commit c50ad79
Author: Alexander Arce <[email protected]>
Date:   Tue Nov 13 14:34:37 2018 +0100

    Adapted tests for jest

commit 7c59e97
Author: Alexander Arce <[email protected]>
Date:   Tue Nov 13 14:34:23 2018 +0100

    Added silent in winston for testing

commit f1850bb
Author: Alexander Arce <[email protected]>
Date:   Tue Nov 13 14:33:56 2018 +0100

    Added supertest and superagent

commit d5b45ab
Author: Alexander Arce <[email protected]>
Date:   Tue Nov 13 14:33:39 2018 +0100

    Now we are using jest for testing

commit 867d30c
Author: Òscar Casajuana <[email protected]>
Date:   Tue Nov 13 13:48:06 2018 +0100

    All execution-plugins are now tested with jest

commit 236a873
Author: Òscar Casajuana <[email protected]>
Date:   Tue Nov 13 13:22:18 2018 +0100

    Replacing sinon, mocha and chai with jest

    refs #26

commit 32cdb14
Author: Alexander Arce <[email protected]>
Date:   Tue Nov 13 13:05:08 2018 +0100

    Dirty commit
@elboletaire
Copy link
Member Author

Closed in 8526f86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant