-
Notifications
You must be signed in to change notification settings - Fork 34
Unify approach for cucumber and non-cucumber jobs across SDK's in CI #229
Description
Problem - Disparate approach to Testing and CI
Although all SDK's must pass a mostly identical set of cucumber features, there are still many differences that can make it difficult for Algorand developers needing to work across more than one SDK.
Solution
Implement the following guidelines for circle config tasks as well as Makefile naming conventions:
- Circle
.configguidelines:- Job that runs
make docker-testshould be calleddocker-test - Whenever possible, circle jobs should call directly into
Makefile - Whenever possible, circle job names should be the same as their final
Makefiletarget. EG: Javascript'scompile_testjob might be renamedcompile-testand call a new targetcompile-test.
- Job that runs
Makefilenaming conventions:- keep the current "common _universal_targets" (see below)
- keep the current "SDK varying targets" (see below).
- reserve the following special targets to have the following meanings:
XYZ-unit- unit tests not defined by cucumber features and which avoid all such features without warning messagesXYZ-integration- similar to the previous but for non-cucumber integration tests
- aim to unify the naming of other common tasks such as:
lint- a task that encompasses all linters and format checksgenerate-docs
Dependencies
None
Urgency
Low / Medium - this is more of a nuisance than a huge problem. However, in anticipation for #228, it will be quite useful to take the actions items above, as transitioning to github actions will be much more consistent across SDK's and therefore easier to achieve.
Research Findings
Following recent changes (#220) SDK Makefile's have the following targets:
- common universal targets
unit&integration- for running cucumber testsharness- for bootstrapping the Sandbox based test harnessdocker-test- for running all cucumber tests in a docker container using the harness sandbox
- SDK varying targets
docker-XYZsdk-buildanddocker-XYZsdk-run- for building and running the sdk's docker containerdisplay-all-XYZ-steps- for scraping all implemented cucumber steps
- there are special targets as well that only exist in a particular SDK such as:
formatin the Javascript SDKlint,generate,build,fmt, ... in the Go SDK
Currently, the Circle CI configs don't consistently call their repo's Makefiles. In particular:
- Java: has a
unit-testjob that runsmvn testinside of anadoptopenjdk/maven-openjdk11docker - Python: has a
unit-testjob that runspytest tests/unit_testsas well as adocsetjob that generates docs - Javascript: has the most complex circle config:
- job
ESLintrunsnpm run list - job
prettierrunsnpx prettier --check . - job
compile_testrunsnpx prettier --check . - job
generate_docs
- job
The only exception is that all consistently call make docker-test through a circle job either called integration-test or build_and_test or test.
Links
- Java
- Python
- Javascript
- Go