Skip to content

Commit

Permalink
Merge pull request #1040 from aeternity/feature/test-else-exclude-aens
Browse files Browse the repository at this point in the history
test-else: Exclude aens tests and speedup jobs
  • Loading branch information
davidyuk authored Jul 3, 2020
2 parents a10f340 + 2047ea8 commit e3e6314
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ before_install:
fi
- docker-compose up -d

install: npm ci --ignore-scripts

jobs:
include:
- stage: Tests
Expand All @@ -26,5 +28,6 @@ jobs:
- npm run report-coverage
- name: Test Contract, Node, Oracle, Account and else
script:
- npm run build
- npm run test-else
- npm run report-coverage
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"docs:api": "node apidoc.js",
"test": "nyc --require @babel/register mocha --recursive --exit",
"report-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"test-channel": "nyc --require @babel/register mocha \"./test/integration/channel.js\" --exit",
"test-aens": "nyc --require @babel/register mocha \"./test/integration/aens.js\"",
"test-else": "nyc --require @babel/register mocha \"./test/**/!(aens|channel).js\"",
"test-channel": "nyc --require @babel/register mocha ./test/integration/channel.js --exit",
"test-aens": "nyc --require @babel/register mocha ./test/integration/aens.js",
"test-else": "nyc --require @babel/register mocha './test/**/!(aens|channel).js'",
"test:watch": "mocha --recursive --require @babel/register --watch",
"prepare": "npm run build",
"genChangelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
Expand Down
15 changes: 1 addition & 14 deletions test/integration/aens.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,11 @@

import { describe, it, before } from 'mocha'
import { configure, plan, ready } from './'
import { randomName } from '../utils'
import * as R from 'ramda'
import { generateKeyPair } from '../../es/utils/crypto'
import { buildContractId, classify, computeAuctionEndBlock, computeBidFee } from '../../es/tx/builder/helpers'

export function randomName (length, namespace = '.chain') {
return randomString(length) + namespace
}

function randomString (len, charSet) {
charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
let randomString = ''
for (let i = 0; i < len; i++) {
const randomPoz = Math.floor(Math.random() * charSet.length)
randomString += charSet.substring(randomPoz, randomPoz + 1)
}
return randomString
}

plan('99000000000000000000000000')

describe('Aens', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { BaseAe, configure, plan, ready, compilerUrl, publicKey } from './'
import { decode } from '../../es/tx/builder/helpers'

import * as R from 'ramda'
import { randomName } from './aens'
import { randomName } from '../utils'
import { decodeEvents, readType, SOPHIA_TYPES } from '../../es/contract/aci/transformation'
import { hash, personalMessageToBinary } from '../../es/utils/crypto'
import { getFunctionACI } from '../../es/contract/aci/helpers'
Expand Down
13 changes: 13 additions & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function randomString (len, charSet) {
charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
let randomString = ''
for (let i = 0; i < len; i++) {
const randomPoz = Math.floor(Math.random() * charSet.length)
randomString += charSet.substring(randomPoz, randomPoz + 1)
}
return randomString
}

export function randomName (length, namespace = '.chain') {
return randomString(length) + namespace
}

0 comments on commit e3e6314

Please sign in to comment.