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

Add Unit test running on GitActions #381

Merged
merged 58 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
afd9ba5
Add Unit test running on GitActions
RicardoMDomingues Sep 19, 2024
fdcf989
Fix
RicardoMDomingues Sep 19, 2024
b87d744
Fix
RicardoMDomingues Sep 19, 2024
b50d485
Try
RicardoMDomingues Sep 19, 2024
3b3c2ef
Test
RicardoMDomingues Sep 19, 2024
a866779
Fix
RicardoMDomingues Sep 19, 2024
9371056
fix
RicardoMDomingues Sep 19, 2024
8c18f5e
Fix
RicardoMDomingues Sep 20, 2024
50f7d98
Try
RicardoMDomingues Sep 20, 2024
e06e72d
Fix
RicardoMDomingues Sep 20, 2024
f2b96ed
Test
RicardoMDomingues Sep 20, 2024
db6264d
Try
RicardoMDomingues Sep 20, 2024
2e4e043
Test
RicardoMDomingues Sep 20, 2024
2ad46e9
Fix
RicardoMDomingues Sep 20, 2024
b890e76
Cancel in progress
RicardoMDomingues Sep 20, 2024
231be5b
Test
RicardoMDomingues Sep 20, 2024
2c96dd7
Test
RicardoMDomingues Sep 20, 2024
225c902
Test
RicardoMDomingues Sep 20, 2024
bebf44a
Fix
RicardoMDomingues Sep 20, 2024
b7669d6
Fix
RicardoMDomingues Sep 20, 2024
16267aa
Try
RicardoMDomingues Sep 20, 2024
f31eb11
test
RicardoMDomingues Sep 20, 2024
b26a8b4
Fix
RicardoMDomingues Sep 20, 2024
a1d1a16
try
RicardoMDomingues Sep 20, 2024
47c104c
fix test results path
RicardoMDomingues Sep 20, 2024
4a44005
Fix reporter
RicardoMDomingues Sep 20, 2024
039da71
Try permissions
RicardoMDomingues Sep 20, 2024
c73f4be
Fix permissions
RicardoMDomingues Sep 20, 2024
c78955e
Force test failure
RicardoMDomingues Sep 20, 2024
2783ac9
Try
RicardoMDomingues Sep 20, 2024
8d8e909
try
RicardoMDomingues Sep 20, 2024
6a60016
Enable gitaction debug mode
RicardoMDomingues Sep 20, 2024
d075ff6
test update_check
RicardoMDomingues Sep 20, 2024
940a287
Enable debugging
RicardoMDomingues Sep 20, 2024
8aedfc7
Tests
RicardoMDomingues Sep 21, 2024
f62c3a0
Add detailed
RicardoMDomingues Sep 21, 2024
02b8f5b
Fix test
RicardoMDomingues Sep 21, 2024
034afab
Add coverage step
RicardoMDomingues Sep 23, 2024
eb5ef2f
Fix
RicardoMDomingues Sep 23, 2024
c1a9ce4
-
RicardoMDomingues Sep 23, 2024
a97ce98
Add nodejs 16 to amazon linux
RicardoMDomingues Sep 23, 2024
3a477ca
try force node16 to annotate results
RicardoMDomingues Sep 23, 2024
5dc8a92
Try
RicardoMDomingues Sep 23, 2024
d739a35
test
RicardoMDomingues Sep 23, 2024
29633cb
Fix
RicardoMDomingues Sep 24, 2024
42b1add
Try node 20 on amazon linux docker
RicardoMDomingues Sep 24, 2024
38e406a
Try
RicardoMDomingues Sep 24, 2024
c87c64a
Try upload v3
RicardoMDomingues Sep 24, 2024
c760236
Try
RicardoMDomingues Sep 24, 2024
9e5314b
Fix
RicardoMDomingues Sep 24, 2024
1b5a07a
Fix
RicardoMDomingues Sep 24, 2024
1bccbfe
try
RicardoMDomingues Sep 24, 2024
a710c86
Try again
RicardoMDomingues Sep 24, 2024
f0233a8
use aws-linux latest
RicardoMDomingues Sep 24, 2024
1b71563
try
RicardoMDomingues Sep 24, 2024
96d080b
Upload entire coverage directory
RicardoMDomingues Sep 25, 2024
f334277
Delete el7
RicardoMDomingues Sep 25, 2024
f12ce47
Remove el7
RicardoMDomingues Sep 25, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/cve-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
folder-name: ["aws-linux", "el7", "el8", "ubuntu-focal-deb", "ubuntu-focal" ]
folder-name: ["aws-linux", "el8", "ubuntu-focal-deb", "ubuntu-focal" ]
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v3
Expand Down
102 changes: 102 additions & 0 deletions .github/workflows/pr-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: PR Unit Test

on: [pull_request]

# make GHA actions use node16 which still works with aws-linux
# See https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
# Unclear how long this will work though
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

permissions:
contents: read
packages: read
actions: read
checks: write
statuses: write

jobs:
pr-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- os: aws-linux
image: latest
build:
type: Release
- os: el8
image: latest
build:
type: Release
- os: ubuntu-focal-deb
image: latest
build:
type: Release
- os: ubuntu-focal
image: latest
build:
type: Release
- os: el8
image: latest
build:
type: LCheck
- os: el8
image: latest
build:
type: TCheck
- os: el8
image: latest
build:
type: DCheck
- os: el8
image: latest
build:
type: LCov
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }}-${{ matrix.os }}-${{ matrix.build.type }}
cancel-in-progress: true
container:
image: ghcr.io/finos/symphonymediabridge/buildsmb-${{ matrix.os }}:${{ matrix.image }}
name: pr-check-${{ matrix.os }}-${{ matrix.build.type }}
steps:
- uses: actions/checkout@v3
- name: Mark workspace as safe
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Build
run: docker/${{ matrix.os }}/buildscript.sh ${{ matrix.build.type }}
- name: Run Tests
run: docker/${{ matrix.os }}/runtests.sh
- name: DEBUG search unit tests logs
run: find . -type f -iname "smb_unit_test*"
- name: Upload Unit test logs
uses: actions/upload-artifact@v3
if: always() # This step runs regardless of the previous step results
with:
name: unit-test-logs-${{ matrix.os }}-${{ matrix.build.type }}
retention-days: 14
path: tools/testfiles/smb_unit_test*.log
- name: Upload test results
uses: actions/upload-artifact@v3
if: always() # This step runs regardless of the previous step results
with:
name: test-results-${{ matrix.os }}-${{ matrix.build.type }}
retention-days: 14
path: ${{ matrix.os }}/smb/test-results*.xml
- name: Upload Code Coverage
uses: actions/upload-artifact@v3
if: matrix.build.type =='LCov' && success() # This step runs regardless of the previous step results
with:
name: code-coverage-${{ matrix.os }}-${{ matrix.build.type }}
retention-days: 14
path: ${{ matrix.os }}/smb/coverage/
- name: Annotate test results
uses: mikepenz/action-junit-report@v3
if: success() || failure() # run this step even if previous step failed
with:
check_name: JUnit Test Report ${{ matrix.os }} ${{ matrix.build.type }}
report_paths: ${{ matrix.os }}/smb/test-results*.xml
job_name: pr-check-${{ matrix.os }}-${{ matrix.build.type }}
detailed_summary: true
update_check: true
16 changes: 2 additions & 14 deletions Jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ node('be-integration') {

sh "gcloud auth configure-docker europe-west1-docker.pkg.dev --quiet"

docker.image('europe-west1-docker.pkg.dev/sym-dev-rtc/rtc-jenkins-tools/buildsmb-el7:latest').inside {
stage('Build Centos 7') {
env.GIT_COMMITTER_NAME = "Jenkins deployment job"
env.GIT_COMMITTER_EMAIL = "[email protected]"
sh "docker/el7/buildscript.sh Release"
}

stage('Run tests centos7') {
sh "docker/el7/runtests.sh"
}
}

docker.image('europe-west1-docker.pkg.dev/sym-dev-rtc/rtc-jenkins-tools/buildsmb-el8:latest').inside {
stage('Build RHEL 8') {
env.GIT_COMMITTER_NAME = "Jenkins deployment job"
Expand Down Expand Up @@ -98,9 +86,9 @@ node('be-integration') {
}
}

docker.image('europe-west1-docker.pkg.dev/sym-dev-rtc/rtc-jenkins-tools/buildsmb-el7:latest').inside {
docker.image('europe-west1-docker.pkg.dev/sym-dev-rtc/rtc-jenkins-tools/buildsmb-ubuntu-focal-deb:latest').inside {
stage('Create archive') {
sh "zip -r ${baseName}-${version}.zip el7/smb/smb el7/smb/versioninfo.txt el7/smb/libs/ el8/smb/smb el8/smb/versioninfo.txt el8/smb/libs/ ubuntu-jammy/smb/smb ubuntu-jammy/smb/versioninfo.txt ubuntu-jammy/smb/libs/ ubuntu-focal-deb/smb/*.tar.gz ubuntu-focal-deb/smb/*.deb aws-linux/smb/versioninfo.txt aws-linux/smb/libs/ aws-linux/smb/smb"
sh "zip -r ${baseName}-${version}.zip el8/smb/smb el8/smb/versioninfo.txt el8/smb/libs/ ubuntu-jammy/smb/smb ubuntu-jammy/smb/versioninfo.txt ubuntu-jammy/smb/libs/ ubuntu-focal-deb/smb/*.tar.gz ubuntu-focal-deb/smb/*.deb aws-linux/smb/versioninfo.txt aws-linux/smb/libs/ aws-linux/smb/smb"
}
}

Expand Down
7 changes: 2 additions & 5 deletions Jenkins/PRUnitTestRunner.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ void prRunner(String cmakeBuildType, String platform, String dockerTag) {
}

abortPreviousRunningBuilds()
parallel "Release el7": {
node('be-integration') {
prRunner("Release", "el7", "latest")
}
}, "Release AWS-linux": {

parallel "Release AWS-linux": {
node('be-integration') {
prRunner("Release", "aws-linux", "latest")
}
Expand Down
87 changes: 0 additions & 87 deletions docker/el7/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions docker/el7/buildscript.sh

This file was deleted.

9 changes: 0 additions & 9 deletions docker/el7/generate_makefile.sh

This file was deleted.

44 changes: 0 additions & 44 deletions docker/el7/runtests.sh

This file was deleted.

2 changes: 1 addition & 1 deletion docker/prepdocker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage prepdocker.sh <el7|el8|ubuntu-focal|ubuntu-jammy|aws-linux>. Eg. prepdocker.sh el8"
echo "Usage prepdocker.sh <el8|ubuntu-focal|ubuntu-jammy|aws-linux>. Eg. prepdocker.sh el8"
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion test/gtest_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class GtestMain : public ::testing::Environment
utils::Time::initialize();
auto fh = fopen("./smb_unit_test.log", "w");
fclose(fh);
logger::setup("./smb_unit_test.log", true, true, logger::Level::DBG, 8 * 1024 * 1024);
logger::setup("./smb_unit_test.log", false, false, logger::Level::DBG, 8 * 1024 * 1024);
}

void TearDown() override { logger::stop(); }
Expand Down
2 changes: 1 addition & 1 deletion test/gtest_main2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class GtestMain : public ::testing::Environment
utils::Time::initialize();
auto fh = fopen("./smb_unit_test2.log", "w");
fclose(fh);
logger::setup("./smb_unit_test2.log", true, true, logger::Level::DBG, 8 * 1024 * 1024);
logger::setup("./smb_unit_test2.log", false, false, logger::Level::DBG, 8 * 1024 * 1024);
}

void TearDown() override { logger::stop(); }
Expand Down
2 changes: 1 addition & 1 deletion test/integration/IntegrationCallTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TEST_P(IntegrationCallTypesTest, party3AllModes)
auto transportMode = std::get<0>(GetParam());
auto encryptionMode = std::get<1>(GetParam());

logger::info("test transportmode %u, encryption %u", "party3AllModes", transportMode, encryptionMode);
logger::info("test transportmode %d, encryption %d", "party3AllModes", static_cast<int>(transportMode), static_cast<int>(encryptionMode));
auto testBody = [this, transportMode, encryptionMode]() {
_config.readFromString(_defaultSmbConfig);
_config.enableSrtpNullCipher = true;
Expand Down
2 changes: 1 addition & 1 deletion test/transport/IceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ TEST_F(IceRobustness, earlyProbes)

for (auto& session : sessions)
{
logger::info("session state %d", "", session->getState());
logger::info("session state %d", "", static_cast<int>(session->getState()));
log(session->getLocalCandidates());
log(session->getRemoteCandidates());

Expand Down
Loading
Loading