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

Unify approach for cucumber and non-cucumber jobs across SDK's in CI #229

Open
tzaffi opened this issue Aug 25, 2022 · 0 comments
Open

Unify approach for cucumber and non-cucumber jobs across SDK's in CI #229

tzaffi opened this issue Aug 25, 2022 · 0 comments
Labels
new-feature-request Feature request that needs triage Team Scytale

Comments

@tzaffi
Copy link
Contributor

tzaffi commented Aug 25, 2022

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 .config guidelines:
    • Job that runs make docker-test should be called docker-test
    • Whenever possible, circle jobs should call directly into Makefile
    • Whenever possible, circle job names should be the same as their final Makefile target. EG: Javascript's compile_test job might be renamed compile-test and call a new target compile-test.
  • Makefile naming 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 messages
      • XYZ-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 checks
      • generate-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 tests
    • harness - for bootstrapping the Sandbox based test harness
    • docker-test - for running all cucumber tests in a docker container using the harness sandbox
  • SDK varying targets
    • docker-XYZsdk-build and docker-XYZsdk-run - for building and running the sdk's docker container
    • display-all-XYZ-steps - for scraping all implemented cucumber steps
  • there are special targets as well that only exist in a particular SDK such as:
    • format in the Javascript SDK
    • lint, 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-test job that runs mvn test inside of an adoptopenjdk/maven-openjdk11 docker
  • Python: has a unit-test job that runs pytest tests/unit_tests as well as a docset job that generates docs
  • Javascript: has the most complex circle config:
    • job ESLint runs npm run list
    • job prettier runs npx prettier --check .
    • job compile_test runs npx prettier --check .
    • job generate_docs

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

@tzaffi tzaffi added the new-feature-request Feature request that needs triage label Aug 25, 2022
@tzaffi tzaffi changed the title Unify approach for cucumber and non-cucumber tests across SDK's in CI Unify approach for cucumber and non-cucumber jobs across SDK's in CI Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature-request Feature request that needs triage Team Scytale
Projects
None yet
Development

No branches or pull requests

1 participant