diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index bcf1c1275..a4d960b9b 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -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 @@ -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/composite@v1.30 + 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: | diff --git a/.github/workflows/mac-debug-build.yml b/.github/workflows/mac-debug-build.yml index 0387b3d9e..7af047c98 100644 --- a/.github/workflows/mac-debug-build.yml +++ b/.github/workflows/mac-debug-build.yml @@ -12,7 +12,7 @@ env: jobs: build-mac: - runs-on: macos-latest + runs-on: macos-11 env: NOT_CONNETECD: 1 steps: @@ -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/composite@v1.30 + 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: | diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 25099aac1..dfb54cbaa 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -31,7 +31,7 @@ env: jobs: build-windows32: - runs-on: windows-latest + runs-on: windows-2022 steps: - uses: actions/checkout@v2 - name: setup-cppcheck @@ -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/composite@v1.30 + 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: | @@ -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 @@ -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/composite@v1.30 + 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: | @@ -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 diff --git a/src/odbc-test/src/odbc_test_suite.cpp b/src/odbc-test/src/odbc_test_suite.cpp index 7602368a9..2ee01a606 100644 --- a/src/odbc-test/src/odbc_test_suite.cpp +++ b/src/odbc-test/src/odbc_test_suite.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -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() {