Skip to content

Commit

Permalink
Merge branch 'release/4.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
kanjoe24 committed Oct 28, 2024
2 parents 30f3d1a + eece360 commit faf123a
Show file tree
Hide file tree
Showing 8 changed files with 1,075 additions and 4 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [4.0.0](https://github.com/rdkcentral/ut-core/compare/3.2.4...4.0.0)
#### [4.1.0](https://github.com/rdkcentral/ut-core/compare/4.0.0...4.1.0)

- PR: i117 : update ut_template [`#118`](https://github.com/rdkcentral/ut-core/pull/118)
- pr: i73: Basic working automated release script [`#89`](https://github.com/rdkcentral/ut-core/pull/89)
- Modified release-script-ut-core to include changes for CPP support [`f204021`](https://github.com/rdkcentral/ut-core/commit/f204021a0b93f3e9a740b23f855926c542abf16b)
- Incorporating changes for gtests in ut-core release script #73 [`cd05a5c`](https://github.com/rdkcentral/ut-core/commit/cd05a5c2873b2bf3bce97a5a760c72505c6182d9)
- GH73 : bringing in changes for various environments as mentioned on the main ticket [`2808bc6`](https://github.com/rdkcentral/ut-core/commit/2808bc676ff8d07c63be5df9ef22a3c157b3e928)

### [4.0.0](https://github.com/rdkcentral/ut-core/compare/3.2.4...4.0.0)

> 16 October 2024
- pr:i11:Adding changes for Gtest support [`#102`](https://github.com/rdkcentral/ut-core/pull/102)
- Adding first level changes for Gtest support #11 [`458edee`](https://github.com/rdkcentral/ut-core/commit/458edee2d1210293697008f52ab10127c3d412d7)
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ popd > /dev/null # ${MY_DIR}
# Therefore in that case it warns you but doesnt' chnage to that version, which could cause your tests to break.
# Change this to upgrade your ut-control Major versions. Non ABI Changes 1.x.x are supported, between major revisions

UT_CONTROL_PROJECT_VERSION="1.5.1" # Fixed version
UT_CONTROL_PROJECT_VERSION="1.6.0" # Fixed version

# Clone the Unit Test Requirements
[email protected]:rdkcentral/ut-control.git
Expand Down
78 changes: 78 additions & 0 deletions scripts/Release-Test-Script-Platform-Overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Overview for release-test-script-platform.sh

This Bash script is designed for automating the process of cloning a PR branch from platform test suite Git repository, building software, and validating build artifacts across multiple environments. It simplifies testing and development workflows by managing repository setup, environment-specific builds, and post-build checks for required binaries and libraries.
It also checks for the existence of various third party packages like openssl, curl, cmake, gtest etc for various environments listed below.
With these validations, it ensures if the PR is good for merge and has not broken the basic requirements.

Following table gives the overview:

|#|Target|Docker|Expectation
|---|-----|-----------|---------
|1|./build_ut.sh TARGET=arm|rdk-dunfell|builds hal for target arm
|2|./build_ut.sh TARGET=arm|rdk-kirkstone|builds hal for target arm
|3|./build_ut.sh TARGET=linux|vm-sync|builds hal for target linux
|4|./build_ut.sh TARGET=linux|none|builds hal for target linux
|5|./build_ut.sh -C tests/ TARGET=arm|rdk-dunfell|builds hal tests for target arm
|6|./build_ut.sh -C tests/ TARGET=arm|rdk-kirkstone|builds hal tests for target arm
|7|./build_ut.sh -C tests/ TARGET=linux|vm-sync|builds hal tests for target linux
|8|./build_ut.sh -C tests/ TARGET=linux|none|builds hal tests for target linux

## Key Objectives:
1. **Automated Repository Setup**:
Clones a given Git repository (or a default one if not specified) for different target environments (e.g., Ubuntu, VM-SYNC, Dunfell Linux, Dunfell ARM).

where:
VM-SYNC : is a docker simulating the RDK linux environment
Dunfell Linux : is a docker with linux environment
Dunfell ARM : is a docker simulating the arm environment for yocto version dunfell
Kirkstone ARM : is a docker simulating the arm environment for yocto version kirkstone

2. **Environment-Specific Builds**:
Runs a customized build process based on the environment. It supports branching logic to switch and build from a specific branch (`UT_CORE_BRANCH_NAME`) when provided.

3. **Post-Build Checks**:
After compiling, the script verifies:
- The current branch matches the target branch.
- The existence of specific libraries such as:
- [ ] - **CURL static library** (`libcurl.a`)
- [ ] - **OpenSSL static library** (`libssl.a`)
- [ ] - **CMake binary**
- [ ] - **HAL binary**
- Each check outputs either `PASS` or `FAIL`, depending on whether the conditions are met.
- The checks vary based on the environment, allowing for customized validation for each setup.

4. **Cross-Environment Testing**:
Supports testing on multiple environments for following packages:


|#|ENV/PACKAGES|CMAKE(Host)|CURL(Target)|OPENSSL(Target)|GTEST(Target)
|-----|----|--------|------|---------|----------|
|1|Ubuntu+build essentials|NO|YES|NO|YES
|2|VM-SYNC|YES|YES|YES|YES
|3|RDK-DUNFELL(arm)|NO|YES|YES|YES
|4|RDK-DUNFELL(linux)|NO|YES|NO|YES
|5|RDK-KIRKSTONE(arm)|NO|YES|YES|YES
|6|RDK-KIRKSTONE(linux)|NO|YES|NO|YES

For ex:
On env 1, the script will check for availability of CURL library, OpenSSL libraraies and Gtest libraries for Target.It would however would not look for CMAKE binary for host as this environment already provides cmake support which is provided by build essentials.
On env 2, on the other hand, none of the packages are present , hence the script will check for all of the packages listed above.

5. **Error Handling**:
Provides error messaging and graceful exits if any step (cloning, building, or checking) fails, ensuring robust automation.

6. **Output and Logs**:
Generates detailed output, including build logs (`build_log.txt`), and provides real-time feedback about successes and failures for each environment.

## Execution Flow:
1. **Clone the repository** for each environment.
2. **Run environment-specific builds** using the provided or default branch.
3. **Perform checks** on the build output to ensure that necessary files are present.
4. **Print results** for all environments in a summary format for review.

This script is a powerful tool for managing multi-environment development workflows, allowing seamless switching between branches, running builds, and verifying output in a repeatable, automated fashion.

## Caveats:
- Observed that during some of the runs the build_log.txt have undefined reference error, however same is not observed while runing it on terminal (w/o using the script).
In the rare case of the above occurence, user can run manually change to the respective directory, remove `ut/ut-core` and `ut/build/`, and trigger the command : `build_ut.sh TARGET=<TARGET>`.To print the results user can comment all the 4 commands at the end of the bash script except print_results and run the script as usual.
- This script doesnot handle the case of `build_ut.sh TARGET=<TARGET> VARIANT=CPP` as this change is not available from platform test-suit as of now. This script only checks that the PR changes doesnot break the platform test-suit as it exists today.
70 changes: 70 additions & 0 deletions scripts/Release-Test-Script-Ut-Core-Overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Overview of release-test-script-ut-core.sh

## Purpose
This Bash script automates the process of cloning the PR branch on ut-core Git repository, building code, and validating build artifacts across multiple environments. It is designed to handle different system architectures (like ARM and x86) and environments (like Ubuntu, VM-SYNC, Dunfell Linux, Dunfell ARM), simplifying testing, building, and validation processes.
where:
VM-SYNC : is a docker simulating the RDK linux environment
Dunfell Linux : is a docker with linux environment
Dunfell ARM : is a docker simulating the arm environment for yocto version dunfell
Kirkstone ARM : is a docker simulating the arm environment for yocto version kirkstone
It checks for the existence of various third party packages like openssl, curl, cmake, gtest etc for various environments listed above.
With these validations, it ensures if the PR is good for merge and has not broken the basic requirements.

Following table gives the overview:

|#|Target|Docker|Expectation
|---|-----|-----------|---------
|1|make TARGET=arm|rdk-dunfell|builds ut-core for target arm
|2|make TARGET=arm|rdk-kirkstone|builds ut-core for target arm
|3|make TARGET=linux|vm-sync|builds ut-core for target linux
|4|make TARGET=linux|none|builds ut-core for target linux
|5|make -C tests/ TARGET=arm|rdk-dunfell|builds ut-core tests for target arm
|6|make -C tests/ TARGET=arm|rdk-kirkstone|builds ut-core tests for target arm
|7|make -C tests/ TARGET=linux|vm-sync|builds ut-core tests for target linux
|8|make -C tests/ TARGET=linux|none|builds ut-core tests for target linux

## Key Features

1. **Repository Cloning**:
- The script clones a specified branch from ut-core Git repository.
- A default repository (`[email protected]:rdkcentral/ut-core.git`) is used if none is provided.

2. **Environment-Specific Build Setup**:
- Supports different environments such as Ubuntu, VM-SYNC, Dunfell Linux, and Dunfell ARM.
- The script runs platform-specific build commands (e.g., `make` for Linux or ARM) in each environment.

3. **Logging Build Outputs**:
- The script runs the `make` command for different targets (e.g., `linux`, `arm`) and variants (`CPP`), and logs all outputs to files such as `make_log.txt`, `make_cpp_log.txt`, etc.
- Logs can be reviewed in case of build failure.

4. **Build Verification**:
- After building, the script checks if key artifacts :
- [ ] - static libraries - CURL, OpenSSL, GTest exist
- [ ] - binaries - CMake exist.
- Each environment has customized checks based on expected outputs (for instance, checking for the OpenSSL static library in some environments and not in others).

5. **Error Handling**:
- If any part of the process (cloning, building, or checking) fails, the script provides detailed error messages and exits.

6. **Environment Support**:
Supports testing on multiple environments for following packages:


|#|ENV/PACKAGES|CMAKE(Host)|CURL(Target)|OPENSSL(Target)|GTEST(Target)
|---|----|--------|------|---------|----------|
|1|Ubuntu+build essentials|NO|YES|NO|YES
|2|VM-SYNC|YES|YES|YES|YES
|3|RDK-DUNFELL(arm)|NO|YES|YES|YES
|4|RDK-DUNFELL(linux)|NO|YES|NO|YES
|5|RDK-KIRKSTONE(arm)|NO|YES|YES|YES
|6|RDK-KIRKSTONE(linux)|NO|YES|NO|YES

For ex:
On env 1, the script will check for availability of CURL library, OpenSSL libraraies and Gtest libraries for Target.It would however would not look for CMAKE binary for host as this environment already provides cmake support which is provided by build essentials.
On env 2, on the other hand, none of the packages are present , hence the script will check for all of the packages listed above.



## Usage Example
```bash
./release-test-script-ut-core.sh -t <BRANCH_NAME_TO_BE_TESTED_ON_UT_CORE_REPO>
Loading

0 comments on commit faf123a

Please sign in to comment.