clamp-orchestrator / clamp-core

A microservices flow orchestrator and workflow manager.
https://clamp-orchestrator.github.io/clamp-orchestrator/
MIT License
9 stars 4 forks source link

Changes for fixing golangci-lint issues #87

Closed sivachandran closed 3 years ago

sivachandran commented 3 years ago

Addresses issue #83

Change summary

There are many more linter issues that require authors' consensus on how to resolve them.

Refer linter-issues.txt for pending linter issues.

priyaaank commented 3 years ago

Tests need to be fixed for this to be merged successfullyy

sivachandran commented 3 years ago

@priyaaank There are many test failures even in the master branch. Do you want to fix master test failures first?

priyaaank commented 3 years ago

Hey, @sivachandran Thanks for the feedback.

The CI tests were green here https://app.circleci.com/pipelines/github/clamp-orchestrator/clamp-core?branch=master

However, I checked and looks like that while the tests are passing there is a step that uploads the code quality report to CodeClimate with every test run. This is intended to execute only on the CI, but executes locally as well and fails. Although I doubt this is the error you encountered. But it has been fixed as part of PR #90

The Latest CI execution is here https://app.circleci.com/pipelines/github/clamp-orchestrator/clamp-core/120/workflows/f11a3bf7-9011-4860-a273-e7519eb57c3a/jobs/146 requires login with your GitHub id

Since there are various kinds of tests (unit, integration, and functional) and require several moving parts to be set up (Kafka, Zookeeper, rabbitmq, Postgres, etc.) And if one of those components is not working, the tests might fail. I think this is what you may have encountered.

Here are the remediation steps for that. I am also updating documentation here

At the end of the test, you should see that artifact could not be saved. This is expected since CircleCI CLI does not support it in the local environment. However, the tests should be green with all components managed by the CLI. This is how output would look like Screen Shot 2021-01-30 at 12 19 25 PM

You can choose to avoid circleci CLI and run the test as specified in the documentation here https://clamp-orchestrator.github.io/clamp-orchestrator/docs/core-contribution-guide#running-tests-locally But in that case please ensure all components are set up and running as expected.

This is how the outcome of the build should look Screen Shot 2021-01-30 at 12 08 25 PM

Let me know if this helps with the setup and helps you run the tests successfully.

sivachandran commented 3 years ago

Thank you @priyaaank for the detailed response.

I assumed the unit tests do not require external dependencies like RabbitMQ or Kafka. Now, relooking at the error log, I can see many errors are related to not having the dependencies running.

I will set up CircleCI CLI and try.