Skip to content

Commit 71b8500

Browse files
authored
[RDKEMW-5410] RDKEMW-6572 : Compilation error was not reported for the PR branch (#211)
* Reffering to current branch * For PR purpose added github.head_ref * Fixing copilot review comments * Adding description to caller_branch * Adding develop branch in ref * Modifying L1, L2 yml files * Modifying README in Tests folder * Modifying Branch to Trigger Source
1 parent 152ff74 commit 71b8500

File tree

4 files changed

+62
-28
lines changed

4 files changed

+62
-28
lines changed

.github/workflows/L1-tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: L1-tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
caller_source:
7+
description: "Specifies the source type (e.g., local or test framework) for the workflow."
8+
required: true
9+
type: string
510
secrets:
611
RDKCM_RDKE:
712
required: true
@@ -69,6 +74,7 @@ jobs:
6974
- name: ACK External Trigger
7075
run: |
7176
echo "Message: External Trigger Received for L1 Tests"
77+
echo "Trigger Source: ${{ inputs.caller_source }}"
7278
7379
- name: Set up CMake
7480
uses: jwlawson/[email protected]
@@ -121,6 +127,13 @@ jobs:
121127
token: ${{ secrets.RDKCM_RDKE }}
122128

123129
- name: Checkout entservices-inputoutput
130+
if: ${{ inputs.caller_source == 'local' }}
131+
uses: actions/checkout@v3
132+
with:
133+
path: entservices-inputoutput
134+
135+
- name: Checkout entservices-inputoutput-testframework
136+
if: ${{ inputs.caller_source == 'testframework' }}
124137
uses: actions/checkout@v3
125138
with:
126139
repository: rdkcentral/entservices-inputoutput

.github/workflows/L2-tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: L2-tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
caller_source:
7+
description: "Specifies the source type (e.g., local or test framework) for the workflow."
8+
required: true
9+
type: string
510
secrets:
611
RDKCM_RDKE:
712
required: true
@@ -39,6 +44,7 @@ jobs:
3944
- name: ACK External Trigger
4045
run: |
4146
echo "Message: External Trigger Received for L2 Tests"
47+
echo "Trigger Source: ${{ inputs.caller_source }}"
4248
4349
- name: Set up CMake
4450
uses: jwlawson/[email protected]
@@ -83,6 +89,13 @@ jobs:
8389
ref: R4.4.3
8490

8591
- name: Checkout entservices-inputoutput
92+
if: ${{ inputs.caller_source == 'local' }}
93+
uses: actions/checkout@v3
94+
with:
95+
path: entservices-inputoutput
96+
97+
- name: Checkout entservices-inputoutput-testframework
98+
if: ${{ inputs.caller_source == 'testframework' }}
8699
uses: actions/checkout@v3
87100
with:
88101
repository: rdkcentral/entservices-inputoutput

.github/workflows/tests-trigger.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ on:
1111
jobs:
1212
trigger-L1:
1313
uses: ./.github/workflows/L1-tests.yml
14+
with:
15+
caller_source: local
1416
secrets:
1517
RDKCM_RDKE: ${{ secrets.RDKCM_RDKE }}
1618

1719
trigger-L2:
1820
uses: ./.github/workflows/L2-tests.yml
21+
with:
22+
caller_source: local
1923
secrets:
2024
RDKCM_RDKE: ${{ secrets.RDKCM_RDKE }}
21-

Tests/README.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,54 @@ Hence, any modifications/additions related to mocks should be commited to entser
66

77
# Individual Repo Handling
88
Each individual entservices-* repo was added with a .yml file to trigger L1, L2, L2-OOP test job in github workflow. This yml file triggers below mentioned build jobs in addition to regular build jobs (thunder, thunder tools & etc,).
9-
9+
```
1010
a/ Build mocks => To create TestMock Lib from all required mock relates stubs and copy to install/usr/lib path.
1111
b/ Build entservices-<repo-name> => To create Test Lib of .so type from all applicable test files which are enabled for plugin test.
1212
c/ Build entservices-testframework => To create L1/L2 executable by linking the plugins/test .so files.
13-
13+
```
1414
This ensures everything in-tact in repo level across multiple related plugins when there is a new change comes in.
1515

16-
# testframework Repo Handling
17-
The entservices-testframework repo contains yml files corresponds to L1, L2 & L2-OOP to trigger test job in github workflow.
18-
19-
This yml file triggers below mentioned build jobs in addition to regular build jobs (thunder, thunder tools & etc,).
20-
21-
a/ Build mocks => To create TestMock Lib from all required mock relates stubs and copy to install/usr/lib path.
22-
b/ Build entservices-* => Jobs to checkout/build all individual repo's plugin & test files which are enabled for plugin test and copy all required libs to install/usr/lib path.
23-
c/ Build entservices-testframework => To create L1/L2 executable by linking the plugins/test .so files.
24-
25-
This ensures everything in-tact across multiple repos when there is a new change comes either in mocks or test case or plugins.
26-
2716
##### Steps to run L1, L2, L2-OOP test locally #####
17+
```
2818
1. checkout the entservices-<repo-name> to your working directory in your build machine.
29-
example: git clone https://github.com/rdkcentral/entservices-testframework.git
19+
example: git clone https://github.com/rdkcentral/entservices-deviceanddisplay.git
3020
3121
2. switch to entservices-<repo-name> directory
32-
example: cd entservices-testframework
22+
example: cd entservices-deviceanddisplay
3323
3424
3. check and ensure current working branch points to develop
3525
example: git branch
3626
3727
4. Run below curl command to download act executable to your repo.
3828
example: curl -SL https://raw.githubusercontent.com/nektos/act/master/install.sh | bash
3929
40-
5. 5a/to run L1 test
41-
example: ./bin/act -W .github/workflows/L1-tests.yml -s GITHUB_TOKEN=<your access token>
30+
5. Run L1, L2, L2-oop test
31+
example: ./bin/act -W .github/workflows/tests-trigger.yml -s GITHUB_TOKEN=<your access token>
4232
43-
5. 5b/to run L2 test
44-
example: ./bin/act -W .github/workflows/L2-tests.yml -s GITHUB_TOKEN=<your access token>
45-
46-
5. 5c/to run L2 test OOP
47-
example: ./bin/act -W .github/workflows/L2-tests-oop.yml -s GITHUB_TOKEN=<your access token>
33+
NOTE: By default test-trigger.yml will trigger all tests(L1, L2 and etc) parallely, if you want any one test alone to be triggered/verified then remove the other trigger rules from the tests-trigger.yml
34+
```
35+
# testframework Repo Handling
36+
tf-trigger.yml file of testframework repo will get loaded into github action whenever there is a pull or push happens. This file in-turn triggers all individual repos L1, L2, L2-oop tests. testframework repo test can run only in github workflow.
4837

49-
NOTES:
50-
a/ If you face any secret token related error while run your yml, pls comment the below mentioned line
38+
NOTE:
39+
If you face any secret token related error while run your yml, pls comment the below mentioned line
5140
#token: ${{ secrets.RDKE_GITHUB_TOKEN }}
52-
b/ Coverage Report of both L1 and L2 test are uploaded to artifacts server.
53-
c/ For the case, which has modification in plugin and/or test files as well in entservices-testframework mock files, change the ref key of checkout job to point your own branch instead of develop, in both entservices-testframework and entservices-* repo and ensure L1, L2, L2-OOP test jobs are passing for your PR.
54-
example: ref: feature/L1-test
41+
42+
# Execution usecases where manual change required before triggering the test:
43+
```
44+
a/ changes in testframework repo only:
45+
Need to change ref pointer of "Checkout entservices-testframework" job in individual repo yml file, to point your current working branch of testframework and in tftrigger.yml of testframework repo need to change trigger branch name to your individual repo branch name instead of develop which is default.
46+
example:
47+
ref: topic/method_1 /* Checkout entservices-testframework job */
48+
uses: rdkcentral/entservices-deviceanddisplay/.github/workflows/L1-tests.yml@topic/method_1 /* tf-trigger.yml */
49+
50+
b/ changes in both testframework repo and invidual repo:
51+
Changes mentioned in step (a) above + "Checkout entservices-deviceanddisplay-testframework" job in individual repo yml file, ref field to point your deviceanddisplay current working branch.
52+
example:
53+
ref: topic/method_1 /* Checkout entservices-testframework job */
54+
ref: topic/method_1 /* Checkout entservices-deviceanddisplay-testframework job */
55+
uses: rdkcentral/entservices-deviceanddisplay/.github/workflows/L1-tests.yml@topic/method_1 /* tf-trigger.yml */
56+
57+
c/ changes in individual entservices-* repo only
58+
no changes required
59+
```

0 commit comments

Comments
 (0)