Skip to content

Commit

Permalink
[AD-612] Publish/posting TestResults (#34)
Browse files Browse the repository at this point in the history
* [AD-612] uncomment code for posting test results

* [AD-612] change to always upload test results

* [AD-612] implement boost log

* format of test results is set as JUnit

* [AD-612] make macos build post test results with EnricoMi

* [AD-612]make windows build post test results with EnricoMi

* enable post results for win32 build

* [AD-612] change keyword from path to files

* files keyword is supported with EnricoMi, not path

* [AD-612] change upload test result to composite action

* [AD-612] modify action for win32

* modified publish unit test results from container action to composite action for win32

* [AD-612] generate test report inside /bin folder

* moved code that generates test results file to odbc_test_suite.cpp, so that the code is not in a .h file.
Now the test result is generated under the same folder when bin/Release/ignite-odbc-tests.exe or bin/Debug/ignite-odbc-tests.exe is called

* [AD-612] modify path to test result

* path to test result is set inside ODBC_BIN_PATH because that's where the file would be generated
* comments added for historical records

* [AD-612] refactor - remove comments

* [AD-612] debug change path to test result .xml file

* [AD-612] refactor

* remove comments in win-build.yml

* [AD-612] remove define boost_test_module

* reason: the code is not reflected on the test result for unknown reasons.

* [AD-612] refactor

* remove empty lines and spaces

* [AD-612] specify the test report filename

* [AD-612] separate comments for different builds

* [AD-612] separate comments for different builds

* add value for check_name parameter as well

* [AD-612] add OS version name to comments

* [AD-612] specify environment version on Yaml

* newest environments are used. Specify the version so we know what version we're working on
* MacOS environment will be macOS Big Sur 11
* Windows environment will be Windows 2022
  • Loading branch information
alinaliBQ authored Mar 4, 2022
1 parent 3a92513 commit faa138b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 29 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/mac-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env:

jobs:
build-mac:
runs-on: macos-latest
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Get Java distribution
Expand Down Expand Up @@ -79,12 +79,13 @@ jobs:
run: |
ssh -f -N -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${{env.DOC_DB_PRIV_KEY_FILE}} -L${{env.DOC_DB_LOCAL_PORT}}:${{secrets.DOC_DB_HOST}}:${{env.DOC_DB_REMOTE_PORT}} ${{secrets.DOC_DB_USER}}
./build/odbc/bin/ignite-odbc-tests
# - name: upload-test-report
# if: failure()
# uses: actions/upload-artifact@v2
# with:
# name: test-result-macos
# path: ${{ github.workspace }}/report.xml
- name: upload-test-report
if: always()
uses: EnricoMi/publish-unit-test-result-action/[email protected]
with:
check_name: "MacOS Big Sur 11 Build Unit Test Results Check"
comment_title: "MacOS Big Sur 11 Build Unit Test Results"
files: ./odbc_test_result.xml
# - name: print-memory-leak-logs
# if: always()
# run: |
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/mac-debug-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
build-mac:
runs-on: macos-latest
runs-on: macos-11
env:
NOT_CONNETECD: 1
steps:
Expand Down Expand Up @@ -48,12 +48,13 @@ jobs:
# - name: run-tests
# run: |
# ./build/odbc/bin/tests --gtest_output="xml:report.xml"
# - name: upload-test-report
# if: failure()
# uses: actions/upload-artifact@v2
# with:
# name: test-result-macos
# path: ${{ github.workspace }}\report.xml
- name: upload-test-report
if: always()
uses: EnricoMi/publish-unit-test-result-action/[email protected]
with:
check_name: "MacOS Big Sur 11 Debug Build Unit Test Results Check"
comment_title: "MacOS Big Sur 11 Debug Build Unit Test Results"
files: ./odbc_test_result.xml
# - name: print-memory-leak-logs
# if: always()
# run: |
Expand Down
34 changes: 19 additions & 15 deletions .github/workflows/win-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:

jobs:
build-windows32:
runs-on: windows-latest
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: setup-cppcheck
Expand Down Expand Up @@ -98,12 +98,14 @@ jobs:
run: |
Start-Process -NoNewWindow ssh "-f -N -o UserKnownHostsFile=/temp -o StrictHostKeyChecking=no -i ${{env.DOC_DB_PRIV_KEY_FILE}} -L${{env.DOC_DB_LOCAL_PORT}}:${{secrets.DOC_DB_HOST}}:${{env.DOC_DB_REMOTE_PORT}} ${{secrets.DOC_DB_USER}}"
${{env.ODBC_BIN_PATH}}/ignite-odbc-tests.exe
# - name: upload-test-report
# if: failure()
# uses: actions/upload-artifact@v2
# with:
# name: test-logs-win32
# path: ${{ github.workspace }}\report.xml
- name: upload-test-report
if: always()
uses: EnricoMi/publish-unit-test-result-action/[email protected]
with:
check_name: "Windows x32 Build Unit Test Results Check"
comment_title: "Windows 2022 (x32) Build Unit Test Results"
files: ./odbc_test_result.xml
# - name: build-installer
# if: success()
# run: |
Expand Down Expand Up @@ -131,7 +133,7 @@ jobs:
# name: windows-test-results
# path: $CI_OUTPUT_PATH/test
build-windows64:
runs-on: windows-latest
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: run-cppcheck
Expand Down Expand Up @@ -197,12 +199,14 @@ jobs:
run: |
Start-Process -NoNewWindow ssh "-f -N -o UserKnownHostsFile=/temp -o StrictHostKeyChecking=no -i ${{env.DOC_DB_PRIV_KEY_FILE}} -L${{env.DOC_DB_LOCAL_PORT}}:${{secrets.DOC_DB_HOST}}:${{env.DOC_DB_REMOTE_PORT}} ${{secrets.DOC_DB_USER}}"
${{env.ODBC_BIN_PATH}}/ignite-odbc-tests.exe
# - name: upload-test-report
# if: failure()
# uses: actions/upload-artifact@v2
# with:
# name: test-logs-win64
# path: ${{ github.workspace }}\report.xml
- name: upload-test-report
if: always()
uses: EnricoMi/publish-unit-test-result-action/[email protected]
with:
check_name: "Windows 2022 (x64) Build Unit Test Results Check"
comment_title: "Windows 2022 (x64) Build Unit Test Results"
files: ./odbc_test_result.xml
# - name: build-installer
# if: success()
# run: |
Expand All @@ -224,7 +228,7 @@ jobs:
# name: windows64-installer
# path: ci-output/installer
build-windows64_coverage:
runs-on: windows-latest
runs-on: windows-2022
steps:
- uses: actions/checkout@v2

Expand Down
18 changes: 18 additions & 0 deletions src/odbc-test/src/odbc_test_suite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <ignite/odbc/common/fixed_size_array.h>
#include <sql.h>
#include <sqlext.h>
#include <fstream>

#include <boost/test/unit_test.hpp>

Expand All @@ -31,6 +32,23 @@
using namespace ignite_test;
using namespace boost::unit_test;

/**
* Test setup config for test results
*/
struct OdbcConfig {
OdbcConfig() : test_log("odbc_test_result.xml") {
unit_test_log.set_stream(test_log);
unit_test_log.set_format(OF_JUNIT);
}
~OdbcConfig() {
unit_test_log.set_stream(std::cout);
}

std::ofstream test_log;
};

BOOST_GLOBAL_FIXTURE(OdbcConfig);

namespace ignite {
namespace odbc {
void OdbcTestSuite::Prepare() {
Expand Down

0 comments on commit faa138b

Please sign in to comment.