From 5b836cc9608d241a5f60c60985717b4bd0fb560c Mon Sep 17 00:00:00 2001 From: EclesioMeloJunior Date: Thu, 19 Jan 2023 14:30:00 -0400 Subject: [PATCH 1/3] chore: resolve name missmatch --- tests/polkadotjs_test/start_polkadotjs_test.go | 4 +--- tests/polkadotjs_test/test/test-polkadot.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/polkadotjs_test/start_polkadotjs_test.go b/tests/polkadotjs_test/start_polkadotjs_test.go index 0f8c61354e..feaf9fa2a5 100644 --- a/tests/polkadotjs_test/start_polkadotjs_test.go +++ b/tests/polkadotjs_test/start_polkadotjs_test.go @@ -19,8 +19,6 @@ import ( var polkadotSuite = "polkadot" -// TODO: add test against latest dev runtime -// See https://github.com/ChainSafe/gossamer/issues/2705 func TestStartGossamerAndPolkadotAPI(t *testing.T) { if utils.MODE != polkadotSuite { t.Log("Going to skip polkadot.js/api suite tests") @@ -48,7 +46,7 @@ func TestStartGossamerAndPolkadotAPI(t *testing.T) { t.Log("starting gossamer for polkadot.js/api tests...") tomlConfig := config.Default() - tomlConfig.Init.Genesis = libutils.GetDevV3SubstrateGenesisPath(t) + tomlConfig.Init.Genesis = libutils.GetWestendLocalRawGenesisPath(t) tomlConfig.Core.BABELead = true tomlConfig.RPC.WS = true tomlConfig.RPC.Unsafe = true diff --git a/tests/polkadotjs_test/test/test-polkadot.js b/tests/polkadotjs_test/test/test-polkadot.js index 3eb86fcce5..361f540be1 100644 --- a/tests/polkadotjs_test/test/test-polkadot.js +++ b/tests/polkadotjs_test/test/test-polkadot.js @@ -56,7 +56,7 @@ describe('Testing polkadot.js/api calls:', function () { it('call api.runtimeVersion', async function () { const runtimeVersion = await api.runtimeVersion; expect(runtimeVersion).to.be.not.null; - expect(runtimeVersion).to.have.property('specName').contains('node') + expect(runtimeVersion).to.have.property('specName').contains('westend') expect(runtimeVersion).to.have.property('apis').lengthOf.above(10) }); From 26b8780c15cd6d47df3cfa9db0f34b43b8754429 Mon Sep 17 00:00:00 2001 From: EclesioMeloJunior Date: Thu, 19 Jan 2023 14:50:06 -0400 Subject: [PATCH 2/3] chore: fix polkadot js test suite and improve error messages --- tests/polkadotjs_test/test/test-polkadot.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/polkadotjs_test/test/test-polkadot.js b/tests/polkadotjs_test/test/test-polkadot.js index 361f540be1..4c8da69277 100644 --- a/tests/polkadotjs_test/test/test-polkadot.js +++ b/tests/polkadotjs_test/test/test-polkadot.js @@ -56,7 +56,8 @@ describe('Testing polkadot.js/api calls:', function () { it('call api.runtimeVersion', async function () { const runtimeVersion = await api.runtimeVersion; expect(runtimeVersion).to.be.not.null; - expect(runtimeVersion).to.have.property('specName').contains('westend') + expect(runtimeVersion).to.have.property('specName') + .contains('westend', `runtimeVersion.specName expected to contains: westend, got ${runtimeVersion.specName}`) expect(runtimeVersion).to.have.property('apis').lengthOf.above(10) }); @@ -116,7 +117,8 @@ describe('Testing polkadot.js/api calls:', function () { describe('api system', () => { it('call api.rpc.system.chain()', async function () { const chain = await api.rpc.system.chain(); - expect(chain).to.contain('Gossamer'); + expect(chain).to + .contain('Westend', `api.rpc.system.chain() expected to contains: Westend, got ${chain}`); }); it('call api.rpc.system.properties()', async function () { From 08feb48a789de394ed18b387074e39e78ba25d1e Mon Sep 17 00:00:00 2001 From: EclesioMeloJunior Date: Thu, 19 Jan 2023 14:59:39 -0400 Subject: [PATCH 3/3] chore: rollback error message --- tests/polkadotjs_test/test/test-polkadot.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/polkadotjs_test/test/test-polkadot.js b/tests/polkadotjs_test/test/test-polkadot.js index 4c8da69277..e0377b548f 100644 --- a/tests/polkadotjs_test/test/test-polkadot.js +++ b/tests/polkadotjs_test/test/test-polkadot.js @@ -56,8 +56,7 @@ describe('Testing polkadot.js/api calls:', function () { it('call api.runtimeVersion', async function () { const runtimeVersion = await api.runtimeVersion; expect(runtimeVersion).to.be.not.null; - expect(runtimeVersion).to.have.property('specName') - .contains('westend', `runtimeVersion.specName expected to contains: westend, got ${runtimeVersion.specName}`) + expect(runtimeVersion).to.have.property('specName').contains('westend'); expect(runtimeVersion).to.have.property('apis').lengthOf.above(10) }); @@ -117,8 +116,7 @@ describe('Testing polkadot.js/api calls:', function () { describe('api system', () => { it('call api.rpc.system.chain()', async function () { const chain = await api.rpc.system.chain(); - expect(chain).to - .contain('Westend', `api.rpc.system.chain() expected to contains: Westend, got ${chain}`); + expect(chain).to.contain('Westend') }); it('call api.rpc.system.properties()', async function () {