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

Establish automated testing frameworks of new GH pulls #69

Closed
1 of 5 tasks
LuncBurner opened this issue Jan 26, 2023 · 6 comments · Fixed by #142 or #167
Closed
1 of 5 tasks

Establish automated testing frameworks of new GH pulls #69

LuncBurner opened this issue Jan 26, 2023 · 6 comments · Fixed by #142 or #167
Assignees
Labels
enhancement New feature or request infrastructure Infrastructure required to sustain the L1 team development out of scope work that is unapproved by the community, but still essential for the L1 team

Comments

@LuncBurner
Copy link
Collaborator

LuncBurner commented Jan 26, 2023

Problem definition

We need to establish a fully fledged e2e test flow that will allow us to do all the existing testing, as well as regression, UI and fuzz testing.

I. Why we need to setup an automated testing framework?

In many cases, we have observed that unit test isn't enough to guarantee that the whole system will not break. We simply got lucky when Ed found a problem through his manual system testing that may not always happen.

In some cases, not even the unit test is correct due to writer misunderstanding of required logic.

II. Framework

  1. Standarize writing unit test (we can even go further with a ci to check). A PR should include:
  • feature specification (in written markdown file in a folder called feature-request) (Gherkin language)
  • unit test write
  1. a full - fledged e2e test flow through ci that does following flow
  • upgrade testing:
    • for chain (if exists, else use current terrad): do an upgrade gov test to newer chain binary
    • for wasm (if there are changes to wasm, else use current wasm files): change to newer wasm files
  • regression testing (change to system should not break existing one)
    • backend:
      • chain should run normal
      • ibc should work normal
      • wasm should run normal
      • state sync should run normal
    • frontend: api testing of most important transaction types and query
  • fuzz testing:
    • some nice background reading: https://github.com/osmosis-labs/osmosis/blob/main/simulation/ADR.md
    • we need to care only about events that invoke a state change, we then create randomized request to these events:
      • transaction: create randomized request and broadcast multiple times
      • begin block: randomized environment condition that invokes a begin block logic (Ex: system time, number of validators, ...)
      • end block: randomized environment condition that invokes an end block logic (Ex: system time, number of validators, ...)
      • init genesis: create randomized genesis state

It is hard to invoke a begin, end block logic without first understanding what environment condition it relies on.

Feature specification

  • Outline general framework as goal for testing refactor
  • Specification and activity diagram of multiple pipelines
  • Review the existing workflows and determine what we can re-use.
  • Refactor existing workflows to fit into new "pipeline architecture".
  • Implement new actions / workflows for missing test types (Unit testing, Integration testing, System Test, Fuzz Testing, UI Testing)

Additional context

Acceptance criteria

This issue needs to be broken down into multiple issues. This one is more like tracking issue.

Goals of this one should be the creation and definition of smaller testing issues (which I don't know fully yet)

@LuncBurner LuncBurner added the enhancement New feature or request label Feb 6, 2023
@LuncBurner LuncBurner added this to the Proposal 11168 milestone Feb 6, 2023
@ZaradarBH ZaradarBH added the out of scope work that is unapproved by the community, but still essential for the L1 team label Feb 8, 2023
@ZaradarBH ZaradarBH added discuss Still being debated needs specification This issue has not been sufficiently specified infrastructure Infrastructure required to sustain the L1 team development and removed enhancement New feature or request labels Feb 15, 2023
@ZaradarBH ZaradarBH removed the discuss Still being debated label Feb 20, 2023
@ZaradarBH
Copy link
Contributor

Maybe visualize the new pipeline with activity diagrams via https://app.diagrams.net/ and drop it in https://github.com/classic-terra/documents

@nghuyenthevinh2000
Copy link
Contributor

@fragwuerdig @ZaradarBH I have just written the frame work. Can you guys comment on it

@ZaradarBH
Copy link
Contributor

Epic work m8. I will remove the "needs specification" label and move it to the "ready" column :)

@ZaradarBH ZaradarBH removed the needs specification This issue has not been sufficiently specified label Feb 22, 2023
@ZaradarBH ZaradarBH reopened this Feb 24, 2023
@ZaradarBH ZaradarBH reopened this Mar 7, 2023
@nghuyenthevinh2000
Copy link
Contributor

moving around informal system, I have found a repo on model - based testing for cosmos chains: https://github.com/informalsystems/atomkraft. Should be interesting to cover all unit test

@ZaradarBH ZaradarBH added the enhancement New feature or request label Mar 16, 2023
@inon-man
Copy link
Collaborator

Closing outdate issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request infrastructure Infrastructure required to sustain the L1 team development out of scope work that is unapproved by the community, but still essential for the L1 team
Projects
Status: 📋 Backlog
5 participants