Skip to content
Draft
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
4 changes: 3 additions & 1 deletion bundles/org.openhab.ui/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ All web development happens in the `web/` directory.
### Building and Testing
- Use `npm run build` to create a production build of the web application.
- Use `npm run test:unit` to run unit tests with Vitest.
- Write unit tests for utilities, and composables where appropriate. Focus on testing logic and behavior rather than implementation details. Store tests alongside the code they test, using the `.test.ts` suffix (e.g., `useWidget.test.ts` for `useWidget.ts`).
- Write unit tests for utilities, and composables where appropriate. Focus on testing logic and behavior rather than implementation details.
Store tests alongside the code they test, using the `.test.ts` suffix (e.g., `useWidget.test.ts` for `useWidget.ts`).
An exception to the rule is if the amount of testfiles significantly clutters the source directory, in which case a separate `__tests__/` directory can be used.

## File-Specific Guidelines

Expand Down
1 change: 0 additions & 1 deletion bundles/org.openhab.ui/pom.xml
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.

Just as a initial note:
We deliberately decided to leave out unit tests from the Maven build, as in some IDEs this can lead to very slow builds or build loops (IIRC @Nadahar).
Integration tests and all other UI tooling is run on PR and main push as dedicated GHA workflow.

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.

Just to elaborate: It's not a problem with Eclipse, but with how the tests were being run. Maven have different phases, and tests are supposed to run in the "test" phase. That was not what was done, it was run during the "compile" or "package" phase I think. Those are correctly executed by Eclipse when rebuilding, tests are not.

It was decided that it was easier to just remove the tests than to integrate it "correctly" with Maven, and let the CI run them explicitly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the clarification! Does that mean we "only" have to make sure that these tests here are run in the test phase? Was there a particular reason why this was (or is?) not the case at that time (or still ist)?

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.

My memory is somewhat faded, but I think the reason was the NPM plugin that is used from Maven, and that it didn't handle it properly - or perhaps that it was done wrong in OH. Anyway, AFAICR, it ran tests and all together with the regular build.

If you can make the tests just run in the Maven test phase, I don't think there is a problem.

Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
<arguments>install --save false</arguments>
</configuration>
</execution>

<execution>
<id>npm run build:mvn</id>
<goals>
Expand Down
Loading
Loading