RocketChat / Rocket.Chat.js.SDK

Utility for apps and bots to interact with Rocket.Chat via DDP and/or API
MIT License
136 stars 95 forks source link

Rocket.Chat CI container for SDK tests #8

Open timkinnane opened 6 years ago

timkinnane commented 6 years ago

SDK tests require a parallel instance of Rocket.Chat (provisioned by the utils/setup.ts script) to run test interactions.

Currently it can only pass tests in local development, because it requires a manually provisioned instance to be running on localhost. Would be best if it can be scripted to create it's own temporary docker instance of Rocket.Chat, so tests can run in the CI environment.

The instance would need a default admin user/pass, then the test setup utils can use the API to create/edit/remove any other users or rooms required before/after each test.

JSzaszvari commented 6 years ago

@timkinnane Did you want me to sort this out for you? Would take me a hour or two

timkinnane commented 6 years ago

@JSzaszvari Amazing. No hurry though, kinda just flagging it so I don't forget.

It just needs these env vars for defaults ADMIN_USERNAME=admin and ADMIN_PASS=pass

Would this be something you'd set up within Circle CI as some kind of pre-test requirement, or could it run from command line script so it can be used locally too. The latter would be nice for anyone wanting to do development, so they don't have to wait for CI to tell them they've broken something, but maybe a nice-to-have if that complicates things.

JSzaszvari commented 6 years ago

@timkinnane I would set it up so that it spins everything up locally. Using a external CI service, like you said would just be too slow for a Dev environment

timkinnane commented 6 years ago

@JSzaszvari Cool, but I guess that would allow the same process to be automated in Circle CI anyway right? That would be nice so we can get green lights on PRs.

JSzaszvari commented 6 years ago

It should (In theory) I'll give it a try and make sure it works. Haven't used Circle in a while (I use GitLab CI and Jenkins) but I'm sure it won't be a issue

rodrigok commented 6 years ago

We already spin up a Rocket.Chat service when running the core tests.

Maybe we could use a container image to run the server by the tests like we do for mongodb here https://github.com/RocketChat/Rocket.Chat/blob/develop/.circleci/config.yml#L138

knrt10 commented 5 years ago

Would like to fix this.