Skip to content

Commit

Permalink
Merge pull request #249 from bitfinexcom/beta
Browse files Browse the repository at this point in the history
Release version to master
  • Loading branch information
prdn authored Jan 18, 2023
2 parents 9fb0a56 + a05a82d commit 9e53883
Show file tree
Hide file tree
Showing 23 changed files with 798 additions and 518 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bfx-reports-framework",
"version": "4.0.0",
"version": "4.1.0",
"description": "Bitfinex reports framework",
"main": "worker.js",
"license": "Apache-2.0",
Expand Down
5 changes: 4 additions & 1 deletion test/1-api-sync-mode-sqlite.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const agent = request.agent(app)

const {
apiSyncModeSqliteTestCases,
signUpTestCase
signUpTestCase,
removeUserTestCases
} = require('./test-cases')

let wrkReportServiceApi = null
Expand Down Expand Up @@ -94,4 +95,6 @@ describe('Sync mode API with SQLite', () => {

signUpTestCase(agent, params)
apiSyncModeSqliteTestCases(agent, params)
signUpTestCase(agent, params)
removeUserTestCases(agent, params)
})
98 changes: 8 additions & 90 deletions test/3-api-filter-sync-mode-sqlite.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ const {
startEnvironment
} = require('./helpers/helpers.boot')
const {
emptyDB,
delay
emptyDB
} = require('./helpers/helpers.core')
const {
createMockRESTv2SrvWithDate
Expand All @@ -31,7 +30,10 @@ process.env.NODE_CONFIG_DIR = path.join(__dirname, 'config')
const { app } = require('bfx-report-express')
const agent = request.agent(app)

const { signUpTestCase } = require('./test-cases')
const {
signUpTestCase,
getSyncProgressTestCase
} = require('./test-cases')

let wrkReportServiceApi = null
let processorQueue = null
Expand Down Expand Up @@ -120,35 +122,7 @@ describe('API filter', () => {
)
})

it('it should be successfully performed by the getSyncProgress method', async function () {
this.timeout(60000)

while (true) {
const res = await agent
.post(`${basePath}/json-rpc`)
.type('json')
.send({
auth,
method: 'getSyncProgress',
id: 5
})
.expect('Content-Type', /json/)
.expect(200)

assert.isObject(res.body)
assert.propertyVal(res.body, 'id', 5)
assert.isNumber(res.body.result)

if (
typeof res.body.result !== 'number' ||
res.body.result === 100
) {
break
}

await delay()
}
})
getSyncProgressTestCase(agent, { basePath, auth })

it('it should be successfully performed by the editPublicTradesConf method', async function () {
this.timeout(5000)
Expand All @@ -175,35 +149,7 @@ describe('API filter', () => {
assert.isOk(res.body.result)
})

it('it should be successfully performed by the getSyncProgress method', async function () {
this.timeout(60000)

while (true) {
const res = await agent
.post(`${basePath}/json-rpc`)
.type('json')
.send({
auth,
method: 'getSyncProgress',
id: 5
})
.expect('Content-Type', /json/)
.expect(200)

assert.isObject(res.body)
assert.propertyVal(res.body, 'id', 5)
assert.isNumber(res.body.result)

if (
typeof res.body.result !== 'number' ||
res.body.result === 100
) {
break
}

await delay()
}
})
getSyncProgressTestCase(agent, { basePath, auth })

it('it should be successfully performed by the editTickersHistoryConf method', async function () {
this.timeout(5000)
Expand All @@ -230,35 +176,7 @@ describe('API filter', () => {
assert.isOk(res.body.result)
})

it('it should be successfully performed by the getSyncProgress method', async function () {
this.timeout(60000)

while (true) {
const res = await agent
.post(`${basePath}/json-rpc`)
.type('json')
.send({
auth,
method: 'getSyncProgress',
id: 5
})
.expect('Content-Type', /json/)
.expect(200)

assert.isObject(res.body)
assert.propertyVal(res.body, 'id', 5)
assert.isNumber(res.body.result)

if (
typeof res.body.result !== 'number' ||
res.body.result === 100
) {
break
}

await delay()
}
})
getSyncProgressTestCase(agent, { basePath, auth })

it('it should be successfully performed by the api methods', async function () {
this.timeout(10000)
Expand Down
8 changes: 7 additions & 1 deletion test/4-sub-account.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const agent = request.agent(app)
const {
apiSyncModeSqliteTestCases,
additionalApiSyncModeSqliteTestCases,
signUpTestCase
signUpTestCase,
removeUserTestCases
} = require('./test-cases')

let wrkReportServiceApi = null
Expand Down Expand Up @@ -429,5 +430,10 @@ describe('Sub-account', () => {

additionalApiSyncModeSqliteTestCases(agent, params)
})
describe('Removing sub-account API', () => {
before(beforeFn)

removeUserTestCases(agent, params)
})
})
})
96 changes: 6 additions & 90 deletions test/6-update-sub-account.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const {
} = require('./helpers/helpers.boot')
const {
emptyDB,
getRServiceProxy,
delay
getRServiceProxy
} = require('./helpers/helpers.core')
const {
createMockRESTv2SrvWithDate,
Expand All @@ -31,7 +30,8 @@ const { app } = require('bfx-report-express')
const agent = request.agent(app)

const {
signUpTestCase
signUpTestCase,
getSyncProgressTestCase
} = require('./test-cases')

let wrkReportServiceApi = null
Expand Down Expand Up @@ -289,35 +289,7 @@ describe('Update sub-account', () => {
assert.isOk(res.body.result)
})

it('it should be successfully performed by the getSyncProgress method', async function () {
this.timeout(60000)

while (true) {
const res = await agent
.post(`${basePath}/json-rpc`)
.type('json')
.send({
auth: subAccountAuth,
method: 'getSyncProgress',
id: 5
})
.expect('Content-Type', /json/)
.expect(200)

assert.isObject(res.body)
assert.propertyVal(res.body, 'id', 5)
assert.isNumber(res.body.result)

if (
typeof res.body.result !== 'number' ||
res.body.result === 100
) {
break
}

await delay()
}
})
getSyncProgressTestCase(agent, { basePath, auth: subAccountAuth })

it('it should be successfully performed by the getLedgers method, without params', async function () {
this.timeout(5000)
Expand Down Expand Up @@ -517,35 +489,7 @@ describe('Update sub-account', () => {
assert.isString(res.body.result.token)
})

it('it should be successfully performed by the getSyncProgress method', async function () {
this.timeout(60000)

while (true) {
const res = await agent
.post(`${basePath}/json-rpc`)
.type('json')
.send({
auth: subAccountAuth,
method: 'getSyncProgress',
id: 5
})
.expect('Content-Type', /json/)
.expect(200)

assert.isObject(res.body)
assert.propertyVal(res.body, 'id', 5)
assert.isNumber(res.body.result)

if (
typeof res.body.result !== 'number' ||
res.body.result === 100
) {
break
}

await delay()
}
})
getSyncProgressTestCase(agent, { basePath, auth: subAccountAuth })

it('it should be successfully performed by the getUsers method', async function () {
this.timeout(5000)
Expand Down Expand Up @@ -587,35 +531,7 @@ describe('Update sub-account', () => {
})
})

it('it should be successfully performed by the getSyncProgress method', async function () {
this.timeout(60000)

while (true) {
const res = await agent
.post(`${basePath}/json-rpc`)
.type('json')
.send({
auth: subAccountAuth,
method: 'getSyncProgress',
id: 5
})
.expect('Content-Type', /json/)
.expect(200)

assert.isObject(res.body)
assert.propertyVal(res.body, 'id', 5)
assert.isNumber(res.body.result)

if (
typeof res.body.result !== 'number' ||
res.body.result === 100
) {
break
}

await delay()
}
})
getSyncProgressTestCase(agent, { basePath, auth: subAccountAuth })

it('it should be successfully performed by the getLedgers method, without params', async function () {
this.timeout(5000)
Expand Down
Loading

0 comments on commit 9e53883

Please sign in to comment.