Skip to content

Commit

Permalink
Merge pull request #231 from IBM/feature/fix-release-issue
Browse files Browse the repository at this point in the history
Fix release issue
  • Loading branch information
bdjos1 authored Feb 23, 2022
2 parents 630e888 + b804149 commit e123b74
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 20 deletions.
2 changes: 2 additions & 0 deletions acceptance-test.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@echo off
set INPUT_FOLDER=%CD%\packages\acceptance-tests\input
set OUTPUT_FOLDER=%CD%\packages\acceptance-tests\output

yarn build:release
call dev.bat
8 changes: 5 additions & 3 deletions acceptance-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
set INPUT_FOLDER=$PWD/packages/acceptance-tests/input
set OUTPUT_FOLDER=$PWD/packages/acceptance-tests/output
. ./dev.sh
export INPUT_FOLDER=$PWD/packages/acceptance-tests/input
export OUTPUT_FOLDER=$PWD/packages/acceptance-tests/output

yarn build:release
sh dev.sh

8 changes: 4 additions & 4 deletions packages/acceptance-tests/puppeteer/eclipse-theia.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const runSpmUiUpgradeHelperTool = async () => {
const page = utils.getPage();
await page.focus("div#theia-app-shell");
await page.keyboard.press('F1');
await page.keyboard.type('Run SPM');
await page.keyboard.type('Run SPM UI Upgrade Helper');
await page.keyboard.press('Enter');
}

Expand All @@ -38,7 +38,7 @@ const waitForWorkingMessageToAppear = async () => {
}

const waitForWorkingMessageToDisappear = async () => {
await utils.getPage().waitForSelector('div.theia-notification-message', { hidden: true, timeout: 30000 });
await utils.getPage().waitForSelector('div.theia-notification-message', { hidden: true, timeout: 40000 });
}

/**
Expand All @@ -50,7 +50,7 @@ const _waitForCorrectNumberOfGitChanges = async (numChanges) => {
await utils.getPage().waitForFunction(
`document.getElementsByClassName("theia-badge-decorator-sidebar").length > 0` +
`&& document.getElementsByClassName("theia-badge-decorator-sidebar")[0].innerText === "${numChanges}"`,
{ timeout: 10000 }
{ timeout: 50000 }
);
}

Expand All @@ -59,7 +59,7 @@ const _listGitChanges = async () => {
let names = [];
for(let i = 0; i < sps.length; i++) {
const spanName = await (await sps[i].getProperty('textContent')).jsonValue();
names.push(spanName);
if (spanName !=="Run SPM UI Upgrade Helper"){names.push(spanName);}
}
return names.sort();
}
Expand Down
7 changes: 4 additions & 3 deletions packages/acceptance-tests/puppeteer/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const utils = require("./utils");
const theia = require("./eclipse-theia");
const generateExpectedFileList = require("../scripts/generate-expected-file-list");

jest.setTimeout(30000);
jest.setTimeout(70000);

test('puppeteer test 1 (kitchen sink data set)', async () => {

Expand All @@ -19,10 +19,11 @@ test('puppeteer test 1 (kitchen sink data set)', async () => {
await theia.runSpmUiUpgradeHelperTool();
await theia.waitForWorkingMessageToAppear();
await theia.waitForWorkingMessageToDisappear();
// const actual = await theia.getGitChanges(expected.length);

// const actual = await theia.getGitChanges(expected.length);

// Assert
//expect(actual).toEqual(expected);
// expect(actual).toEqual(expected);

} finally {
await utils.screenshot("error.png");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ const generateExpectedFileList = datasetName => {
for(let i = 0; i < dataset.cssUpdates; i++) {
changes.push(`has-updates-css-${i}.css`);
}
for(let i = 0; i < dataset.invalidCssFiles; i++) {
changes.push(`invalid-css-file-${i}.css`);
}
for(let i = 0; i < dataset.iconUpdates; i++) {
changes.push(`has-updates-icons-${i}.properties`);
}
Expand All @@ -21,6 +18,9 @@ const generateExpectedFileList = datasetName => {
changes.push("Chevron_Down_Blue30_10px.png");
changes.push("chevron--down10-on-dark.svg");
}
for(let i = 0; i < dataset.windowSizeUpdates; i++) {
changes.push(`has-updates-${i}.uim`);
}
return changes.sort();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const expected = [
"has-updates-css-2.css",
"has-updates-css-1.css",
"has-updates-css-0.css",
"invalid-css-file-0.css",
"invalid-css-file-1.css",
"has-updates-css-and-icons-1.css",
"has-updates-css-and-icons-0.css",
"Chevron_Down_Blue30_10px.png",
Expand All @@ -20,6 +18,9 @@ const expected = [
"has-updates-icons-0.properties",
"has-updates-css-6.css",
"has-updates-css-5.css",
"has-updates-1.uim",
"has-updates-0.uim",
"has-updates-2.uim"
].sort();

test('kitchen-sink file list', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/docker-tasks/docker-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ const dockerTasks = (execFunction = shelljs, props, args) => {
}
if (version !== "latest") {
cmds.push(`docker image tag ${additionalArgs} ${props.imageName}:latest ${props.imageName}:${version}`);
cmds.push(`docker image tag ${additionalArgs} ${props.parserImageName}:latest ${props.imageName}:${version}`);
cmds.push(`docker image tag ${additionalArgs} ${props.nodeImageName}:latest ${props.imageName}:${version}`);
cmds.push(`docker image tag ${additionalArgs} ${props.parserImageName}:latest ${props.parserImageName}:${version}`);
cmds.push(`docker image tag ${additionalArgs} ${props.nodeImageName}:latest ${props.nodeImageName}:${version}`);
}
cmds.push(`docker image tag ${additionalArgs} ${props.imageName}:latest docker.io/${props.username}/${props.imageName}:${version}`);
cmds.push(`docker image tag ${additionalArgs} ${props.parserImageName}:latest docker.io/${props.username}/${props.parserImageName}:${version}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/docker-tasks/docker-tasks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ test("calling 'release <version>' runs the correct commands", () => {
];
const props = yaml.load(inputConfig.join("\n"));
const inputArgs = "release 0.0.1".split(" ");
const expectedCommands = ["docker image tag foo:latest foo:0.0.1", "docker image tag bar:latest foo:0.0.1", "docker image tag baz:latest foo:0.0.1", "docker image tag foo:latest docker.io/folkforms/foo:0.0.1", "docker image tag bar:latest docker.io/folkforms/bar:0.0.1", "docker image tag baz:latest docker.io/folkforms/baz:0.0.1", "docker image push docker.io/folkforms/foo:0.0.1", "docker image push docker.io/folkforms/bar:0.0.1", "docker image push docker.io/folkforms/baz:0.0.1"];
const expectedCommands = ["docker image tag foo:latest foo:0.0.1", "docker image tag bar:latest bar:0.0.1", "docker image tag baz:latest baz:0.0.1", "docker image tag foo:latest docker.io/folkforms/foo:0.0.1", "docker image tag bar:latest docker.io/folkforms/bar:0.0.1", "docker image tag baz:latest docker.io/folkforms/baz:0.0.1", "docker image push docker.io/folkforms/foo:0.0.1", "docker image push docker.io/folkforms/bar:0.0.1", "docker image push docker.io/folkforms/baz:0.0.1"];
const expectedEchos = [];
const expectedErrorCode = 0;

Expand Down
2 changes: 1 addition & 1 deletion packages/release/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const release = (shell, option, version) => {
shell.echo("Building...");
exec(shell, `yarn install-all`);
exec(shell, `yarn test`);
exec(shell, `echo { "version": "${version}" }>version.json`);
exec(shell, `echo { '"'version'"': '"'${version}'"'}>version.json`);
exec(shell, `yarn build:release`);
shell.echo("Creating release branch...");
exec(shell, `git checkout -b v${version}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/release/release.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test('--start option runs the correct commands', () => {
"git tag --list v0.10.0",
"yarn install-all",
"yarn test",
"echo { \"version\": \"0.10.0\" }>version.json",
"echo { '\"'version'\"': '\"'0.10.0'\"'}>version.json",
"yarn build:release",
"git checkout -b v0.10.0",
"git push --set-upstream origin v0.10.0",
Expand Down

0 comments on commit e123b74

Please sign in to comment.