-
Notifications
You must be signed in to change notification settings - Fork 88
SBCOSS-489: Sunbird Knowlg-asset-enrichment - add the GitHub actions to run test cases and code quality checks when a PR raised #818
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
SBCOSS-489: Sunbird Knowlg-asset-enrichment - add the GitHub actions to run test cases and code quality checks when a PR raised #818
Conversation
-the blob URL's which were in the configurations had been deleted so made the config values of test cases to be picked from env
- some of the blob values were still hardcoded and that was causing test cases to fail so made those values to be picked from configurations - the configurations of the test cases will be now picked from env
- some of the blob values were still hardcoded and that was causing test cases to fail so made those values to be picked from configurations - the configurations of the test cases will be now picked from env
-the blob URL's which were in the configurations had been deleted so made the config values of test cases to be picked from env
- some of the blob values were still hardcoded and that was causing test cases to fail so made those values to be picked from configurations - the configurations of the test cases will be now picked from env
- some of the blob values were still hardcoded and that was causing test cases to fail so made those values to be picked from configurations - the configurations of the test cases will be now picked from env
…ity checks for asset-enrichment flink job
…ity checks for asset-enrichment flink job
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR centralizes configuration for blob and schema paths in test resources and introduces a GitHub Actions workflow to enforce build, test coverage, and static analysis on PRs.
- Tests are refactored to load
base-test.conf
ortest.conf
for dynamic blob and schema URLs instead of hard-coded values. - Added
base-test.conf
and expandedtest.conf
to include environment-based placeholders for blob and schema paths. - Introduced
.github/workflows/pr-actions.yml
to run Maven builds, unit tests with JaCoCo coverage, and SonarQube analysis on pull requests.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
jobs-core/src/test/scala/org/sunbird/spec/HTTPUtilSpec.scala | Replaced hard-coded URLs with imagePath from base-test.conf . |
jobs-core/src/test/scala/org/sunbird/spec/DefinitionCacheTestSpec.scala | Switched config load to base-test.conf and injected schema.basePath . |
jobs-core/src/test/resources/base-test.conf | Added optional env placeholders for schema.basePath and blob.input.contentImagePath . |
asset-enrichment/src/test/scala/org/sunbird/job/spec/ThumbnailSpec.scala | Updated tests to use contentImagePath from config. |
asset-enrichment/src/test/scala/org/sunbird/job/spec/AssetEnrichmentTaskTestSpec.scala | Injected imagePath and videoPath into several test cases. |
asset-enrichment/src/test/resources/test.conf | Expanded to include schema.base_path , blob paths, and cloud/storage settings. |
.github/workflows/pr-actions.yml | New CI workflow for PRs: builds, tests with coverage, and SonarQube. |
Comments suppressed due to low confidence (4)
.github/workflows/pr-actions.yml:10
- [nitpick] Job identifier uses
job-core
but the module directory isjobs-core
. Consider renaming toroot-pom-build-and-coverage-jobs-core
for consistency.
root-pom-build-and-coverage-job-core:
jobs-core/src/test/resources/base-test.conf:52
- Provide a default URL fallback for
schema.basePath
to avoid a MissingKey exception whenSCHEMA_BASE_PATH
isn’t set, e.g.,basePath = ${?SCHEMA_BASE_PATH} "https://your.default/schema/path"
.
basePath = ${?SCHEMA_BASE_PATH}
jobs-core/src/test/resources/base-test.conf:58
- Add a default blob URL for
contentImagePath
so tests don’t fail whenBLOB_IMAGE_CONTENT_PATH
is undefined, e.g.,contentImagePath = ${?BLOB_IMAGE_CONTENT_PATH} "https://default/path/to/image.png"
.
contentImagePath = ${?BLOB_IMAGE_CONTENT_PATH}
asset-enrichment/src/test/scala/org/sunbird/job/spec/ThumbnailSpec.scala:26
- Incorrect
copyURLToFile
signature: useFileUtils.copyURLToFile(new URL(imageUrl), new File(destinationPath))
to correctly download the file.
val file = FileUtils.copyURLToFile("do_113233717480390656195", imageUrl, imageUrl.substring(imageUrl.lastIndexOf("/") + 1))
This PR adds a GitHub Actions workflow for PR code coverage and quality checks to the
asset-enrichment flink job
of Sunbird-Knowlg repository.PR Code Coverage
This workflow ensures that every proposed change is validated for code quality and coverage before merging.