diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index ef06eb3f5..5f171ec7e 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -4,9 +4,13 @@ on: tags: - v* jobs: + call-tests: + uses: ./.github/workflows/reusable-tests.yml + secrets: inherit call-build: uses: ./.github/workflows/reusable-build.yml secrets: inherit + needs: call-tests call-publish-v2: uses: ./.github/workflows/reusable-publish-v2.yml secrets: inherit diff --git a/src/cmd/cloud.js b/src/cmd/cloud.js index 31af7cc72..c5303a527 100644 --- a/src/cmd/cloud.js +++ b/src/cmd/cloud.js @@ -881,6 +881,6 @@ function formatAPIErrorMessage(error){ // TODO (mirande): refactor cmd/api.js to do this check by default when appropriate function ensureAPIToken(){ if (!settings.access_token){ - throw new Error(`You're not logged in. Please login using ${chalk.bold.cyan('particle cloud login')} before using this command`); + throw new Error(`You're not logged in. Please login using ${chalk.bold.cyan('particle login')} before using this command`); } } diff --git a/src/cmd/whoami.test.js b/src/cmd/whoami.test.js index 40a1e3d80..c20c53ce5 100644 --- a/src/cmd/whoami.test.js +++ b/src/cmd/whoami.test.js @@ -35,7 +35,7 @@ describe('Whoami Commands', () => { throw new Error('expected promise to be rejected'); }) .catch(error => { - expect(stripAnsi(error.message)).to.eql('You\'re not logged in. Please login using particle cloud login before using this command'); + expect(stripAnsi(error.message)).to.eql('You\'re not logged in. Please login using particle login before using this command'); }); }); diff --git a/src/lib/api-client.js b/src/lib/api-client.js index 83bc45f48..32f68e938 100644 --- a/src/lib/api-client.js +++ b/src/lib/api-client.js @@ -122,7 +122,7 @@ module.exports = class ApiClient { ensureToken(){ if (!this._access_token){ - throw new VError(`You're not logged in. Please login using ${chalk.bold.cyan('particle cloud login')} before using this command`); + throw new VError(`You're not logged in. Please login using ${chalk.bold.cyan('particle login')} before using this command`); } } diff --git a/test/e2e/compile.e2e.js b/test/e2e/compile.e2e.js index 6450a611a..d1cc963e8 100644 --- a/test/e2e/compile.e2e.js +++ b/test/e2e/compile.e2e.js @@ -523,7 +523,7 @@ describe('Compile Commands', () => { const args = ['compile', platform, '.']; const { stdout, stderr, exitCode } = await cli.run(args, { cwd }); - expect(stdout).to.include('Compile failed: You\'re not logged in. Please login using particle cloud login before using this command'); + expect(stdout).to.include('Compile failed: You\'re not logged in. Please login using particle login before using this command'); expect(stderr).to.equal(''); expect(exitCode).to.equal(1); }); diff --git a/test/e2e/help.e2e.js b/test/e2e/help.e2e.js index 41de95f71..56a132e82 100644 --- a/test/e2e/help.e2e.js +++ b/test/e2e/help.e2e.js @@ -66,7 +66,7 @@ describe('Help & Unknown Command / Argument Handling', () => { 'product device', 'product', 'project create', 'project', 'publish', 'serial list', 'serial monitor', 'serial identify', 'serial wifi', 'serial mac', 'serial inspect', 'serial flash', - 'serial', 'subscribe', 'token list', 'token revoke', + 'serial', 'subscribe', 'token revoke', 'token create', 'token', 'udp send', 'udp listen', 'udp', 'update', 'update-cli', 'usb list', 'usb start-listening', 'usb listen', 'usb stop-listening', 'usb safe-mode', 'usb dfu', 'usb reset', diff --git a/test/e2e/logout.e2e.js b/test/e2e/logout.e2e.js index dd2258541..fd7d4a79b 100644 --- a/test/e2e/logout.e2e.js +++ b/test/e2e/logout.e2e.js @@ -1,5 +1,4 @@ const { expect } = require('../setup'); -const { delay } = require('../lib/mocha-utils'); const cli = require('../lib/cli'); const { USERNAME } = require('../lib/env'); @@ -40,13 +39,7 @@ describe('Logout Commands', () => { }); it('Signs out', async () => { - const subprocess = cli.run(['logout']); - - await delay(1000); - subprocess.stdin.write('y'); - subprocess.stdin.end('\n'); - - const { stdout, stderr, exitCode } = await subprocess; + const { stdout, stderr, exitCode } = await cli.run(['logout']); expect(stdout).to.include(`You have been logged out from ${USERNAME}`); expect(stderr).to.equal(''); diff --git a/test/e2e/whoami.e2e.js b/test/e2e/whoami.e2e.js index 407a5a561..b46b901bb 100644 --- a/test/e2e/whoami.e2e.js +++ b/test/e2e/whoami.e2e.js @@ -3,6 +3,7 @@ const cli = require('../lib/cli'); const { USERNAME } = require('../lib/env'); +const stripAnsi = require('strip-ansi'); describe('Whoami Commands', () => { @@ -52,7 +53,7 @@ describe('Whoami Commands', () => { await cli.logout(); const { stdout, stderr, exitCode } = await cli.run('whoami'); - expect(stdout).to.equal('You are not signed in! Please run: `particle login`'); + expect(stripAnsi(stdout)).to.equal('You\'re not logged in. Please login using particle login before using this command'); expect(stderr).to.equal(''); expect(exitCode).to.equal(1); }); diff --git a/test/lib/cli.js b/test/lib/cli.js index 600d60cf4..166833d25 100644 --- a/test/lib/cli.js +++ b/test/lib/cli.js @@ -59,7 +59,7 @@ module.exports.loginToForeignAcct = () => { module.exports.logout = () => { const { run } = module.exports; - return run(['logout'], { input: 'y\n', reject: true }); + return run(['logout'], { reject: true }); }; module.exports.setProfile = (name) => {