Skip to content

Commit

Permalink
[build] Fix config argument order (#151052)
Browse files Browse the repository at this point in the history
Snapshot builds are currently being marked as release builds in the
config service. This impacts the release property in package.json
snapshot builds and pull request deployments.

This was introduced in
1b85815#diff-dbea24da2a777429d025c1da037dd966d65bff2c97a7b78b82a33532f3ad06d9R63
  • Loading branch information
jbudz committed Feb 13, 2023
1 parent 457e13d commit 17855ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions src/dev/build/lib/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ const versionInfo = jest.requireMock('./version_info').getVersionInfo();

expect.addSnapshotSerializer(createAbsolutePathSerializer());

const setup = async ({ targetAllPlatforms = true }: { targetAllPlatforms?: boolean } = {}) => {
const setup = async ({
targetAllPlatforms = true,
isRelease = true,
}: { targetAllPlatforms?: boolean; isRelease?: boolean } = {}) => {
return await Config.create({
isRelease: true,
isRelease,
targetAllPlatforms,
dockerContextUseLocalArtifact: false,
dockerCrossCompile: false,
Expand Down Expand Up @@ -192,6 +195,17 @@ describe('#getBuildSha()', () => {
});
});

describe('#isRelease()', () => {
it('returns true when marked as a release', async () => {
const config = await setup({ isRelease: true });
expect(config.isRelease).toBe(true);
});
it('returns false when not marked as a release', async () => {
const config = await setup({ isRelease: false });
expect(config.isRelease).toBe(false);
});
});

describe('#resolveFromTarget()', () => {
it('resolves a relative path, from the target directory', async () => {
const config = await setup();
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export class Config {
private readonly dockerTag: string | null,
private readonly dockerTagQualifier: string | null,
private readonly dockerPush: boolean,
public readonly downloadFreshNode: boolean,
public readonly isRelease: boolean,
public readonly downloadFreshNode: boolean,
public readonly pluginSelector: PluginSelector
) {
this.pluginFilter = getPluginPackagesFilter(this.pluginSelector);
Expand Down

0 comments on commit 17855ba

Please sign in to comment.