@lifeomic/bitrise
Advanced tools
Comparing version 0.10.0 to 0.10.1
{ | ||
"name": "@lifeomic/bitrise", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Bitrise API client", | ||
@@ -18,3 +18,3 @@ "main": "src/client.js", | ||
"scripts": { | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"coverage": "nyc report --reporter=text-lcov > ./.nyc_output/lcov.info", | ||
"lint": "eslint .", | ||
@@ -25,3 +25,3 @@ "pretest": "yarn lint", | ||
"dependencies": { | ||
"axios": "^0.18.0", | ||
"axios": "^0.21.1", | ||
"axios-retry": "^3.1.1", | ||
@@ -28,0 +28,0 @@ "lodash": "^4.17.10", |
@@ -72,2 +72,8 @@ const isNil = require('lodash/isNil'); | ||
// If the build is completed and there are no more log chunks | ||
if (!!attributes.build_finished && response.data.log_chunks.length === 0) { | ||
// No need to keep watching a completed build | ||
break; | ||
} | ||
timestamp = response.data.timestamp; | ||
@@ -74,0 +80,0 @@ } while (timestamp); |
@@ -131,2 +131,3 @@ const axios = require('axios'); | ||
buildStub.build.status = 1; | ||
buildStub.build.build_finished = new Date().toISOString(); | ||
stubArchivedBuildLog({ appSlug, axios: client, buildSlug, logText }); | ||
@@ -144,2 +145,24 @@ | ||
test.serial('following a successful build, not yet archived, prints the log output', async (test) => { | ||
const { appSlug, build, buildSlug, client } = test.context; | ||
const logText = 'some log text'; | ||
const buildStub = stubGetBuild({ appSlug, axios: client, buildSlug }); | ||
buildStub.build.status = 1; | ||
buildStub.build.build_finished = new Date().toISOString(); | ||
// The client fetchs logs until no more log chunks are returned | ||
// The empty finaly chunck signals the end of the log (when the build is finished) | ||
stubBuildLogStream({ appSlug, axios: client, buildSlug, logChunks: [logText, ''] }); | ||
const write = sinon.stub(process.stdout, 'write'); | ||
try { | ||
await build.follow(); | ||
sinon.assert.calledOnce(write); | ||
sinon.assert.calledWithExactly(write, logText); | ||
} finally { | ||
write.restore(); | ||
} | ||
}); | ||
test('following a failed build that has already finished prints the log output and then errors', async (test) => { | ||
@@ -246,8 +269,8 @@ const { appSlug, build, buildSlug, client } = test.context; | ||
[ | ||
[ 'line one' ], | ||
[ 'heartbeat: waiting for build output...\n' ], | ||
[ 'line two' ], | ||
[ 'line three' ], | ||
[ 'heartbeat: waiting for build output...\n' ], | ||
[ 'line four' ] | ||
['line one'], | ||
['heartbeat: waiting for build output...\n'], | ||
['line two'], | ||
['line three'], | ||
['heartbeat: waiting for build output...\n'], | ||
['line four'] | ||
] | ||
@@ -254,0 +277,0 @@ ); |
@@ -75,3 +75,4 @@ const get = require('lodash/get'); | ||
is_archived: false, | ||
log_chunks: [] | ||
log_chunks: [], | ||
timestamp: new Date().toISOString() | ||
}, | ||
@@ -78,0 +79,0 @@ status: 200 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54696
19
1221
+ Addedaxios@0.21.4(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
- Removedaxios@0.18.1(transitive)
- Removedfollow-redirects@1.5.10(transitive)
- Removedis-buffer@2.0.5(transitive)
Updatedaxios@^0.21.1