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

test-else: Exclude aens tests and speedup jobs #1040

Merged
merged 2 commits into from
Jul 3, 2020
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 .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
4 changes: 2 additions & 2 deletions 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 } 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 Expand Up @@ -56,7 +56,7 @@ namespace Test =


contract Voting =
type test_type = int
type test_type = int
record state = { value: string, key: test_type, testOption: option(string) }
record test_record = { value: string, key: list(test_type) }
entrypoint test : () => int
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
}