Giter VIP home page Giter VIP logo

klaytn-tests's Introduction

Klaytn tests

Common tests for Klaytn clients.

Documentation

You can build the documents html under docs directory:

$ make html

Since this test suite is ported from https://github.com/ethereum/tests, you can also refer to Ethereum's documentation http://ethereum-tests.readthedocs.io/ although the content may not be the same.

Contents of this repository

Test files in the folders below are currently used for testing:

  • BlockchainTests
  • GeneralStateTests
  • RLPTests
  • TransactionTests
  • VMTests

NOTE: Originally BlockchainTests, GeneralStateTests, TransactionTests, and VMTests were created by the testFillers which could be found at https://github.com/ethereum/cpp-ethereum/tree/develop/test/tools/jsontests at src folder. However, Klaytn tests currently cannot use the testFillers. We will make our own filler specification and testFillers.

How to use test set

To use this test set, you need to clone this repository or make a symbolic link inside tests of https://github.com/klaytn/klaytn/ as testdata. For details, see https://github.com/klaytn/klaytn/blob/master/tests/README.md.

Test set sanitation

NOTE: The content in this section may not be valid.

Format

All files should be of the form:

{
	"test1name":
	{
		"test1property1": ...,
		"test1property2": ...,
		...
	},
	"test2name":
	{
		"test2property1": ...,
		"test2property2": ...,
		...
	}
}

Arrays are allowed, but don't use them for sets of properties - only use them for data that is clearly a continuous contiguous sequence of values.

Checkers

Several basic checks against the test-set are performed to ensure that they have been filled and are formatted correctly. Currently, there are three types of checks that we can perform:

  • make TEST_PREFIX.format: check that the JSON is formatted correctly.
  • make TEST_PREFIX.valid: check that the JSON files are valid against the JSON schemas in ./JSONSchema.
  • make TEST_PREFIX.filled: check that the JSON tests are filled with the correct source hashes against the fillers.

The constant TEST_PREFIX is a path prefix to the test-set you're interested in performing the checks on. For instance:

  • make ./src/VMTestsFiller/vmArithmeticTest.format will check that all JSON files in ./src/VMTestsFiller/vmArithmeticTest are formatted correctly.
  • make ./src.valid will check that all the JSON files in ./src are valid against the JSON schemas in ./JSONSchema.
  • make ./BlockchainTests.filled will check that the source hashes in the JSON tests in ./BlockchainTests are the same as the hashes of the fillers in ./src/BlockchainTestsFiller.

These checks are all performed by the file ./test.py, which can be invoked on individual files as well. Run ./test.py with no arguments for help.

Sanitizers

The above checkers are packaged together into sanitizers for each test-suite, marking which testsuites are passing which testers. See the TODOs in the Makefile to see which checkers are enabled for which test-suites.

  • make sani: will run all passing sanitizers on all passing testsuites.

  • make sani-TESTNAME: will run just the passing sanitizers for the given testsuite. TESTNAME can be one of:

    • vm: VMTests and VMTestsFiller
    • gs: GeneralStateTests and GeneralStateTestsFiller
    • bc: BlockchainTests and BlockchainTestsFiller
    • tx: TransactionTests and TransactionTestsFiller

klaytn-tests's People

Contributors

kjhman21 avatar klaytndev avatar ehnuje avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.