Skip to content
Closed
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 src/cmd/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type SignParams = {|
sourceDir: string,
timeout: number,
verbose?: boolean,
channel?: string,
|};

export type SignOptions = {
Expand Down Expand Up @@ -57,6 +58,7 @@ export default function sign(
sourceDir,
timeout,
verbose,
channel,
}: SignParams,
{
build = defaultBuilder,
Expand Down Expand Up @@ -118,6 +120,7 @@ export default function sign(
xpiPath: buildResult.extensionPath,
version: manifestData.version,
downloadDir: artifactsDir,
channel,
});

if (signingResult.id) {
Expand Down
5 changes: 5 additions & 0 deletions src/program.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ Example: $0 --help run.
describe: 'Number of milliseconds to wait before giving up',
type: 'number',
},
'channel': {
describe: 'The channel for which to sign the addon. Either ' +
'\'listed\' or \'unlisted\'',
type: 'string',
},
})
.command('run', 'Run the extension', commands.run, {
'target': {
Expand Down
28 changes: 28 additions & 0 deletions tests/unit/test-cmd/test.sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,34 @@ describe('sign', () => {
}
));

it('passes the channel parameter to the signer', () => withTempDir(
(tmpDir) => {
const stubs = getStubs();
const artifactsDir = path.join(tmpDir.path(), 'some-artifacts-dir');
const applications: ExtensionManifestApplications =
stubs.preValidatedManifest.applications || {gecko: {}};
return sign(tmpDir, stubs, {extraArgs: {
artifactsDir,
channel: 'unlisted',
}})
.then(() => {
sinon.assert.called(stubs.signAddon);
sinon.assert.calledWithMatch(stubs.signAddon, {
apiKey: stubs.signingConfig.apiKey,
apiProxy: stubs.signingConfig.apiProxy,
apiSecret: stubs.signingConfig.apiSecret,
apiUrlPrefix: stubs.signingConfig.apiUrlPrefix,
downloadDir: artifactsDir,
id: applications.gecko.id,
timeout: stubs.signingConfig.timeout,
version: stubs.preValidatedManifest.version,
xpiPath: stubs.buildResult.extensionPath,
channel: 'unlisted',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only important part so you can remove all other parameter assertions.

});
});
}
));

it('passes the verbose flag to the signer', () => withTempDir(
(tmpDir) => {
const stubs = getStubs();
Expand Down