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

[1u5ykup] Oracle Runtime Tests, Runtime Tests deps update, Bugfixes & Cleanup #529

Merged
merged 1 commit into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration-tests/runtime-tests/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ parserOptions:
plugins:
- '@typescript-eslint'
rules: {}
ignorePatterns: ["src/**/**.d.ts", "src/**/**.js", "src/frontend/generated/*"]
ignorePatterns: ["src/**/*.d.ts", "src/**/*.js", "src/frontend/generated/*"]
18 changes: 14 additions & 4 deletions integration-tests/runtime-tests/.mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@
"extension": ["js", "cjs", "mjs"],
"package": "./package.json",
"reporter": "mochawesome",
"slow": "75",
"timeout": "2000",
"reporterOptions": {
"reportFilename": "mochawesome-report",
"quiet": false,
"overwrite": true,
"html": true,
"json": true
},
"slow": 75,
"timeout": 2000,
"retries": 0,
"ui": "bdd",
"watch-files": ["lib/**/*.js", "test/**/*.js"],
"watch-files": ["src/**/*.js", "src/**/*.ts"],
"watch-ignore": ["lib/vendor"],
"require": "src/utils/testSetup.js"
"require": "src/utils/testSetup.js",
"full-trace": true,
"parallel": false
}
643 changes: 317 additions & 326 deletions integration-tests/runtime-tests/package-lock.json

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions integration-tests/runtime-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"type": "commonjs",
"scripts": {
"compile": "tsc --declaration",
"lint": "eslint src/* --fix-dry-run",
"lint": "eslint src/**/*.ts --fix-dry-run",
"prepare": "npm run compile",
"init": "node src/initializeState.js",
"init_and_test": "npm run init && mocha src/test.js --reporter mochawesome",
"test": "ts-mocha --paths --full-trace --async-stack-traces -p tsconfig.json src/test.ts --require src/utils/testSetup.ts",
"test": "ts-mocha --paths -p tsconfig.json src/test.ts",
"gen": "npm run gen:defs && npm run gen:meta",
"gen:defs": "ts-node --skip-project node_modules/.bin/polkadot-types-from-defs --package @composable/types/interfaces --input ./src/types/interfaces",
"gen:meta": "ts-node --skip-project node_modules/.bin/polkadot-types-from-chain --package @composable/types/interfaces --endpoint ws://localhost:9988 --output src/types/interfaces/"
Expand All @@ -25,39 +25,39 @@
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/minimist": "^1.2.2",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"assert": "^2.0.0",
"eslint": "^8.6.0",
"eslint": "^8.7.0",
"eslint-config-google": "^0.14.0",
"mocha-prepare": "^0.1.0",
"ts-mocha": "^8.0.0",
"ts-node": "^9.1.1",
"typescript": "^4.2.4"
"ts-node": "^10.4.0",
"typescript": "^4.5.4"
},
"engines": {
"node": ">=12.0.0"
},
"dependencies": {
"@polkadot/api": "^7.3.1",
"@polkadot/ts": "latest",
"@polkadot/typegen": "^7.3.1",
"@polkadot/types": "^7.3.1",
"@polkadot/types-augment": "^7.3.1",
"@polkadot/types-codec": "^7.3.1",
"@polkadot/types-create": "^7.3.1",
"@polkadot/types-known": "^7.3.1",
"@polkadot/types-support": "^7.3.1",
"@polkadot/api": "^7.4.1",
"@polkadot/ts": "^0.4.22",
"@polkadot/typegen": "^7.4.1",
"@polkadot/types": "^7.4.1",
"@polkadot/types-augment": "^7.4.1",
"@polkadot/types-codec": "^7.4.1",
"@polkadot/types-create": "^7.4.1",
"@polkadot/types-known": "^7.4.1",
"@polkadot/types-support": "^7.4.1",
"@types/mocha": "^9.0.0",
"@types/node": "^17.0.8",
"@types/ramda": "^0.27.62",
"bluebird": "^3.7.2",
"@types/node": "^17.0.9",
"@types/ramda": "^0.27.64",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"minimist": "^1.2.5",
"mocha": "latest",
"mocha": "^8.4.0",
"mochawesome": "^7.0.1",
"ramda": "^0.27.1",
"web3": "^1.6.1"
"ramda": "^0.28.0",
"tsconfig-paths": "^3.12.0",
"web3": "^1.7.0"
}
}
44 changes: 35 additions & 9 deletions integration-tests/runtime-tests/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,47 @@
import { QueryCrowdloanRewardsTests } from './tests/query/crowdloanRewards/queryCrowdloanRewardsTests';
import { TxCrowdloanRewardsTests } from './tests/tx/crowdloanRewards/txCrowdloanRewardsTests';
import { TxBondedFinanceTests } from "@composable/tests/tx/bondedFinance/txBondedFinanceTests";
import { runBefore, runAfter } from "@composable/utils/testSetup";
import { TxOracleTests } from "@composable/tests/tx/oracle/txOracleTests";


describe('Picasso Runtime Tests', function() {
before(async function () {
// Set timeout to 1 minute.
this.timeout(60*1000);
await runBefore();
});

// Query Tests
after(async function() {
// Set timeout to 1 minute.
this.timeout(60*1000);
await runAfter();
});

// Query Crowdloan Rewards Tests
QueryCrowdloanRewardsTests.runQueryCrowdloanRewardsTests();
// Query Tests
describe('Query Tests', function() {
// Query Crowdloan Rewards Tests
QueryCrowdloanRewardsTests.runQueryCrowdloanRewardsTests();
});

// TX Tests
describe('TX Tests', function () {
// TX Crowdloan Rewards Tests
TxCrowdloanRewardsTests.runTxCrowdloanRewardsTests();

// TX bondedFinance Tests
TxBondedFinanceTests.runTxBondedFinanceTests();

// TX Oracle Tests
TxOracleTests.runTxOracleTests();
});

// RPC Tests
describe('RPC Tests', function () {
// No RPC tests implemented yet!
});
});

// TX Tests

// TX Crowdloan Rewards Tests
TxCrowdloanRewardsTests.runTxCrowdloanRewardsTests();

// TX bondedFinance Tests
TxBondedFinanceTests.runTxBondedFinanceTests();

// RPC Tests
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class QueryCrowdloanRewardsTests {
* query.crowdloanRewards.totalContributors()
*/
private static async queryCrowdloanRewardsTotalContributorsTest() {
console.debug('queryCrowdloanRewardsTotalContributorsTest');
const totalContributors = await api.query.crowdloanRewards.totalContributors();
expect(totalContributors.toNumber()).to.be.a('number');
}
Expand Down
Loading