Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate at build time the metadata for theme editor tests #17612

Conversation

brunovianarezende
Copy link
Contributor

Description

The theme editor tests need files describing what are the properties available for the user. This PR creates such files at build time, in the vaadin-dev-server project.

Type of change

  • Bugfix
  • [ X ] Feature

Checklist

  • [ X ] I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • [ X ] I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • [ X ] New and existing tests are passing locally with my change.
  • [ X ] I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

@github-actions
Copy link

github-actions bot commented Sep 12, 2023

Test Results

1 007 files  ±0  1 007 suites  ±0   1h 4m 49s ⏱️ -22s
6 408 tests ±0  6 367 ✔️ ±0  41 💤 ±0  0 ±0 
6 664 runs   - 1  6 616 ✔️  - 1  48 💤 ±0  0 ±0 

Results for commit cf63a75. ± Comparison against base commit 77768a7.

♻️ This comment has been updated with latest results.

Copy link
Member

@MarcinVaadin MarcinVaadin left a comment

Choose a reason for hiding this comment

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

If they are generated at runtime I would not commit them into git. I would put them inside target/test-resources or similar. That way we do not have to push changes each time source TS metadata change.

They should have .json extension.

@brunovianarezende
Copy link
Contributor Author

If they are generated at runtime I would not commit them into git. I would put them inside target/test-resources or similar. That way we do not have to push changes each time source TS metadata change.

I agree. I will try to move them to target/somewhere and see if I can get them, as you suggest.

They should have .json extension.

ok

@szolo
Copy link
Contributor

szolo commented Sep 13, 2023

@brunovianarezende your PR looks awesome! Just remove the metadata information, make sure that it is executed during build, rebase and we are good to go!

Thanks again for a hard and productive work :)

@brunovianarezende
Copy link
Contributor Author

@brunovianarezende your PR looks awesome! Just remove the metadata information, make sure that it is executed during build, rebase and we are good to go!

Thanks again for a hard and productive work :)

thanks! I will see if I can do as suggested by Marcin and then update this PR.

@brunovianarezende
Copy link
Contributor Author

In the last commit I:

  1. removed the txt files from the repository
  2. moved the created metadata files to vaadin-deve-server/src/main/resources/META-INF/metadata
  3. added vaadin-deve-server/src/main/resources/META-INF/metadata to .gitignore, so the files won't be saved in the repository
  4. changed the metadata files extension from '.txt' to '.json'
  5. provided, in vaadin-dev-server, a utility class to read the metadata for a given component
  6. changed test-theme-editor to use this utility class

@brunovianarezende brunovianarezende force-pushed the feature/create-theme-editor-tests-metadata branch 2 times, most recently from c542f7b to bfd860b Compare September 13, 2023 19:49
@szolo
Copy link
Contributor

szolo commented Sep 18, 2023

In the last commit I:

  1. removed the txt files from the repository
  2. moved the created metadata files to vaadin-deve-server/src/main/resources/META-INF/metadata
  3. added vaadin-deve-server/src/main/resources/META-INF/metadata to .gitignore, so the files won't be saved in the repository
  4. changed the metadata files extension from '.txt' to '.json'
  5. provided, in vaadin-dev-server, a utility class to read the metadata for a given component
  6. changed test-theme-editor to use this utility class

These changes are good. I am approving them as well as the while PR. Please rebase and proceed with merge. Thank you!

Instead of writing the metadata to the theme-editor-tests folder and saving
them in the repository, we'll, at build time, write the data to
vaadin-dev-server/src/main/resources/META-INF/metadata and provide a utility
class to read such data for the tests. This dir will be ignored in
.gitignore. This way vaadin-dev-server will be responsible for providing
the info needed and we won't need to change a project as part of building
other project.
@brunovianarezende brunovianarezende force-pushed the feature/create-theme-editor-tests-metadata branch from bfd860b to cf63a75 Compare September 18, 2023 16:22
@brunovianarezende brunovianarezende enabled auto-merge (squash) September 18, 2023 16:24
@sonarcloud
Copy link

sonarcloud bot commented Sep 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@brunovianarezende brunovianarezende merged commit 87031b1 into vaadin:main Sep 19, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants