Skip to content

test: Add e2e-tests#1355

Open
maxreichmann wants to merge 6 commits intomainfrom
test/e2e-tests
Open

test: Add e2e-tests#1355
maxreichmann wants to merge 6 commits intomainfrom
test/e2e-tests

Conversation

@maxreichmann
Copy link
Copy Markdown
Member

@maxreichmann maxreichmann commented Apr 8, 2026

Outsourced of Incremental Build PR #1267:

  • Add "e2e-tests" dir under "internal/"
  • Add tests for following community custom tasks:
    • ui5-tooling-transpile
    • ui5-task-zipper
    • ui5-tooling-modules
    • ui5-tooling-stringreplace
  • Add test for "ui5 --version"

All tests are currently passing (April 8th).

* Add "e2e-tests" dir under "internal/"
* Add tests for following community custom tasks:
- ui5-tooling-transpile
- ui5-task-zipper
- ui5-tooling-modules
- ui5-tooling-stringreplace
* Add test for "ui5 --version"
@maxreichmann maxreichmann requested a review from a team April 8, 2026 14:27
@maxreichmann
Copy link
Copy Markdown
Member Author

@UI5/ui5-team-cor-fnd These tests are not included in any CI pipeline yet. It's up for debate if we want to include them.

Copy link
Copy Markdown
Member

@d3xter666 d3xter666 left a comment

Choose a reason for hiding this comment

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

There's also an e2e test setup in packages/cli.
Can we leverage and consolidate the setup from there?
Or simply clean it up if it's redundant an too complex anymore?

Comment thread internal/e2e-tests/test/build.js
Comment thread internal/e2e-tests/test/build.js Outdated
Comment thread internal/e2e-tests/test/build.js Outdated
@maxreichmann maxreichmann force-pushed the test/e2e-tests branch 3 times, most recently from c3d2478 to deacdaf Compare April 16, 2026 12:37
@maxreichmann
Copy link
Copy Markdown
Member Author

Tests are now included in Github Actions via a separate workflow (internal-e2e-tests.yml) and take about a minute of execution.

@maxreichmann maxreichmann requested review from a team and removed request for RandomByte and d3xter666 April 21, 2026 08:52
Comment thread internal/e2e-tests/README.md Outdated
@maxreichmann maxreichmann requested a review from d3xter666 April 22, 2026 07:27
Copy link
Copy Markdown
Member

@d3xter666 d3xter666 left a comment

Choose a reason for hiding this comment

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

LGTM

@d3xter666 d3xter666 requested a review from a team April 22, 2026 07:39
Copy link
Copy Markdown
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

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

Sorry for the late review

Comment thread internal/e2e-tests/test/version.js Outdated
describe("ui5 version", () => {
test("output the version of the UI5 CLI", ({assert}) => {
const ui5Path = path.resolve(__dirname, "../../../packages/cli/bin/ui5.cjs");
execFile("node", [ui5Path, "--version"], (error, stdout, stderr) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this test is identical to

const {stdout} = await ui5(["--version"]);

Do we need both?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed.

Comment thread internal/e2e-tests/test/build.js Outdated
// Install node_modules
await this._installNodeModules();
// Setup environment
process.env.UI5_DATA_DIR = `${this.dotUi5Path}`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
process.env.UI5_DATA_DIR = `${this.dotUi5Path}`;
process.env.UI5_DATA_DIR = this.dotUi5Path;

Comment thread internal/e2e-tests/test/build.js Outdated
// --------------------------------------------------------------------------------------------

// Modify source files
await fixtureHelper.prepareForNextRun();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this (deletion and fresh copy of sources) necessary here? From what I can see, the source files have not been changed?

@@ -0,0 +1,10 @@
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should have a package-lock.json next to every package.json. Then we can also use ranges for the dependencies

// #2 Build
await fixtureHelper.build(assert, ui5YamlName);

// Test: the dist contains the new controller and the third party import
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we also check whether the thirdparty itself is present in the build result? (unless it's already without the import)

`sap.ui.define([], () => {
return Controller.extend("application.a.controller.New",{
onInit() {
console.log(\${PLACEHOLDER_TEXT});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is not a good example because the result is not valid JavaScript:

console.log(\"INSERTED_TEXT\")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just ran the test and checked the dist output of controller/New.controller.js:
sap.ui.define([],()=>Controller.extend("application.a.controller.New",{onInit(){console.log("INSERTED_TEXT")}})); //# sourceMappingURL=New.controller.js.map

Looks fine to me. Or do you mean something different?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My bad, makes sense 👍🏼

Comment thread internal/e2e-tests/package.json Outdated
"test-watch": "node --test --watch 'test/**/*.js'"
},
"dependencies": {
"adm-zip": "0.5.17"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Dependency is locked via the root package-lock.json, so we can use a range here:

Suggested change
"adm-zip": "0.5.17"
"adm-zip": "^0.5.17"

@@ -0,0 +1,10 @@
{
"name": "application.a.ts",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use a prefix like @ui5-internal for test packages

second: string
}

export default class Main {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we use a proper UI5 controller that extends sap/ui/core/mvc/Controller like in https://github.com/SAP-samples/ui5-typescript-tutorial/blob/main/exercises/ex4/com.myorg.myapp/webapp/controller/BaseController.ts#L13 ?

* Remove version.js ("ui5 --version" test)
* Cleanup code (remove template lit.)
* Remove FixtureHelper.prepareForNextRun() and its usages
* Add package-lock.json to every fixture
* ui5-tooling-modules test: Add check for thirdparty module itself (ChartJS)
* Add version ranges to every relevant package.json
* Prefix fixture packages with "@ui5-internal"
* Replace test controller with more realistic code (modified copy of ui5-typescript-tutorial)
@maxreichmann maxreichmann requested a review from RandomByte April 28, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants