Skip to content
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ yarn*

# Visual Studio Code
.vscode

# Compiled WASM code
*.wasm
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"name": "joystream",
"license": "GPL-3.0-only",
"scripts": {
"test": "yarn && yarn workspaces run test"
"test": "yarn && yarn workspaces run test",
"test-migration": "yarn && yarn workspaces run test-migration"
},
"workspaces": [
"tests/network-tests"
Expand Down
10 changes: 8 additions & 2 deletions tests/network-tests/.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@ COUNCIL_STAKE_GREATER_AMOUNT = 1500
COUNCIL_STAKE_LESSER_AMOUNT = 1000
# Number of members with greater stake in council election test.
COUNCIL_ELECTION_K = 2
# Stake for runtime upgrade proposal test
RUNTIME_UPGRADE_PROPOSAL_STAKE = 200
# Balance to spend using spending proposal
SPENDING_BALANCE = 1000
# Minting capacity for content working group minting capacity test.
MINTING_CAPACITY = 100020
# Stake amount for Rome runtime upgrade proposal
RUNTIME_UPGRADE_PROPOSAL_STAKE = 100000
# Constantinople runtime path
RUNTIME_WASM_PATH = ../../target/release/wbuild/joystream-node-runtime/joystream_node_runtime.compact.wasm
7 changes: 5 additions & 2 deletions tests/network-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
"license": "GPL-3.0-only",
"scripts": {
"build": "tsc --build tsconfig.json",
"test": "mocha -r ts-node/register src/tests/*",
"test": "mocha -r ts-node/register src/tests/constantinople/*",
"test-migration": "mocha -r ts-node/register src/tests/rome/* && mocha -r ts-node/register src/tests/constantinople/*",
"lint": "tslint --project tsconfig.json",
"prettier": "prettier --write ./src"
},
"dependencies": {
"@joystream/types": "^0.7.0",
"@joystream/types": "",
"@rome/types@npm:@joystream/types": "^0.7.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the first "@joystream/types": "../joystream-apps/packages/joy-types", is just a relative path to the latest constantinople @joystream/types package.

But I wanted to confirm my understanding, "@rome/types@npm:@joystream/types" is setting some sort of alias from @rome/types to @joystream/types published on npm ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to do something like:

    "@constantinople/types@npm:@joystream/types": "^0.8.0",
    "@rome/types@npm:@joystream/types": "^0.7.0",

This might be useful but what would be more helpful is to see if we can have two packages in the same workspace setup the same alias to two different versions of the same package name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot merge with package.json having such a relative path to a dependency.
How can we tackle this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the first "@joystream/types": "../joystream-apps/packages/joy-types", is just a relative path to the latest constantinople @joystream/types package.

But I wanted to confirm my understanding, "@rome/types@npm:@joystream/types" is setting some sort of alias from @rome/types to @joystream/types published on npm ?

Exactly, it's an alias.

Would it be possible to do something like:

"@constantinople/types@npm:@joystream/types": "^0.8.0",
"@rome/types@npm:@joystream/types": "^0.7.0",

Yes, after .8 will be published to nexus

We cannot merge with package.json having such a relative path to a dependency.
How can we tackle this.

We can either publish .8 types, or I can put a placeholder here for the relative path.

"@polkadot/api": "^0.96.1",
"@polkadot/keyring": "^1.7.0-beta.5",
"@types/bn.js": "^4.11.5",
"bn.js": "^4.11.8",
"dotenv": "^8.2.0",
"fs": "^0.0.1-security",
"uuid": "^7.0.3"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { membershipTest } from './membershipCreationTest';
import { KeyringPair } from '@polkadot/keyring/types';
import { ApiWrapper } from '../utils/apiWrapper';
import { ApiWrapper } from './utils/apiWrapper';
import { WsProvider, Keyring } from '@polkadot/api';
import { initConfig } from '../utils/config';
import { initConfig } from './utils/config';
import BN = require('bn.js');
import { registerJoystreamTypes, Seat } from '@joystream/types';
import { assert } from 'chai';
import { v4 as uuid } from 'uuid';
import { Utils } from '../utils/utils';
import { Utils } from './utils/utils';

export function councilTest(m1KeyPairs: KeyringPair[], m2KeyPairs: KeyringPair[]) {
initConfig();
Expand Down Expand Up @@ -118,7 +118,7 @@ export function councilTest(m1KeyPairs: KeyringPair[], m2KeyPairs: KeyringPair[]
});
}

describe.skip('Council integration tests', () => {
describe('Council integration tests', () => {
const m1KeyPairs: KeyringPair[] = new Array();
const m2KeyPairs: KeyringPair[] = new Array();
membershipTest(m1KeyPairs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Keyring } from '@polkadot/keyring';
import { assert } from 'chai';
import { KeyringPair } from '@polkadot/keyring/types';
import BN = require('bn.js');
import { ApiWrapper } from '../utils/apiWrapper';
import { initConfig } from '../utils/config';
import { ApiWrapper } from './utils/apiWrapper';
import { initConfig } from './utils/config';
import { v4 as uuid } from 'uuid';

export function membershipTest(nKeyPairs: KeyringPair[]) {
Expand Down Expand Up @@ -50,8 +50,8 @@ export function membershipTest(nKeyPairs: KeyringPair[]) {
);
nKeyPairs.forEach((keyPair, index) =>
apiWrapper
.getMembership(keyPair.address)
.then(membership => assert(!membership.isEmpty, `Account ${keyPair.address} is not a member`))
.getMemberIds(keyPair.address)
.then(membership => assert(membership.length > 0, `Account ${keyPair.address} is not a member`))
);
}).timeout(defaultTimeout);

Expand All @@ -65,7 +65,9 @@ export function membershipTest(nKeyPairs: KeyringPair[]) {
)
);
await apiWrapper.buyMembership(aKeyPair, paidTerms, `late_member_${aKeyPair.address.substring(0, 8)}`, true);
apiWrapper.getMembership(aKeyPair.address).then(membership => assert(membership.isEmpty, 'Account A is a member'));
apiWrapper
.getMemberIds(aKeyPair.address)
.then(membership => assert(membership.length === 0, 'Account A is a member'));
}).timeout(defaultTimeout);

it('Account A was able to buy the membership with sufficient funds', async () => {
Expand All @@ -77,8 +79,8 @@ export function membershipTest(nKeyPairs: KeyringPair[]) {
);
await apiWrapper.buyMembership(aKeyPair, paidTerms, `late_member_${aKeyPair.address.substring(0, 8)}`);
apiWrapper
.getMembership(aKeyPair.address)
.then(membership => assert(!membership.isEmpty, 'Account A is a not member'));
.getMemberIds(aKeyPair.address)
.then(membership => assert(membership.length > 0, 'Account A is a not member'));
}).timeout(defaultTimeout);

after(() => {
Expand Down
Loading