mlToolKits icon indicating copy to clipboard operation
mlToolKits copied to clipboard

Implement tests in microservices

Open learningOrchestraAccount opened this issue 4 years ago • 21 comments

Is your feature request related to a problem? Please describe.

Currently the microservices are hard to make tests, when a PR is created, we need deploy learningOrchestra in a cloud cluster to verify the changes, it is painful!

Describe the solution you'd like

There are a way to make tests in each microservice to ensure the correct working? I don't know a exactly solution.

Describe alternatives you've considered

Maybe we can use mocked files to test each microservice.

Additional context

The microservices are highly coupled, each microservice have rely to other microservices.

@sudiptog81 do you have knowledge to help us with this issue?

riibeirogabriel avatar Oct 04 '20 12:10 riibeirogabriel

@riibeirogabriel I have written tests for REST APIs, I would need to deploy this project to get a feel, working on this. Microservices would need to be distributed across repositories and added as submodules to this repository at some point, when the tight-coupling has been taken care of.

There could be unit tests for each microservice that can be run as separate CI jobs for individual branches and integration test jobs can be run for the master.

sudiptog81 avatar Oct 04 '20 12:10 sudiptog81

@sudiptog81 it sounds like a big challengue! If we put each microservice in a repo, how we will make the deploy of the learningOrchestra? The user will clone each repo in a subfolder like the microservices? It will be painful.

riibeirogabriel avatar Oct 04 '20 13:10 riibeirogabriel

They are separate ideas. Regarding cloning, the --recursive flag shall take care of that, but that idea is for the future. Right now, we can work on individual unit tests and then run all the unit tests using a test script. I still need to work on how to deploy the cluster from a CI environment after tests have run.

sudiptog81 avatar Oct 04 '20 13:10 sudiptog81

You will be very help to this project, i don't know a way to use CI tests with a distributed software, without make the deploy, maybe using mock files.

riibeirogabriel avatar Oct 04 '20 13:10 riibeirogabriel

Do you have a cluster environment (3 machines) to run this software and know how it works?

riibeirogabriel avatar Oct 04 '20 13:10 riibeirogabriel

Maybe can run with 2 machines.

riibeirogabriel avatar Oct 04 '20 13:10 riibeirogabriel

@all-contributors please add @hiperbolt for code and ideas

riibeirogabriel avatar Oct 04 '20 14:10 riibeirogabriel

@riibeirogabriel

I've put up a pull request to add @hiperbolt! :tada:

allcontributors[bot] avatar Oct 04 '20 14:10 allcontributors[bot]

@sudiptog81 I suggest maybe an azure pipeline with pre-made mock files. I'm interested on how this issue gets fixed.

hiperbolt avatar Oct 04 '20 14:10 hiperbolt

@sudiptog81 Would you like make this issue together with @hiperbolt ?

riibeirogabriel avatar Oct 04 '20 14:10 riibeirogabriel

@sudiptog81 Do you yet have interest in this issue? Case negative i can pass to other person.

riibeirogabriel avatar Oct 06 '20 00:10 riibeirogabriel

Please unassign me from this particular issue and pass on, kind of busy for a few days.

sudiptog81 avatar Oct 06 '20 00:10 sudiptog81

@sudiptog81 no problems, if you have future interest, please send me a message.

riibeirogabriel avatar Oct 06 '20 08:10 riibeirogabriel

@hiperbolt do you can this alone?

riibeirogabriel avatar Oct 06 '20 08:10 riibeirogabriel

@riibeirogabriel Yeah I think I can work on this on my own.

hiperbolt avatar Oct 06 '20 08:10 hiperbolt

I can help you, but i have little knowledge on microservices test, i think this require some studies about.

riibeirogabriel avatar Oct 06 '20 08:10 riibeirogabriel

I'll take my time researching it. I'll talk to you about ideas on how to approach this.

hiperbolt avatar Oct 06 '20 09:10 hiperbolt

I'm going with unit tests with mockfiles for each microservice, using github/azure pipelines for CI/CD. I'm going to start work on the mock files and unit tests and once those are done I'll update here.

hiperbolt avatar Oct 06 '20 21:10 hiperbolt

Sorry I haven't been active on this issue. I'm going to start work on it today.

hiperbolt avatar Oct 22 '20 16:10 hiperbolt

@hiperbolt no problem, take your time.

riibeirogabriel avatar Oct 22 '20 18:10 riibeirogabriel