Skip to content

Commit

Permalink
Merge pull request #95 from Bit-Quill/lyndon/AT-864-829-sample-applic…
Browse files Browse the repository at this point in the history
…ation-and-dsn

AT-829/AT-864/AT-874 - Modify sample application for Linux, Fix DSN issues on Linux, Fix driver warnings and enable all warnings
  • Loading branch information
lyndonbauto authored Jul 6, 2021
2 parents f39e7fb + bed3ecc commit 22972db
Show file tree
Hide file tree
Showing 31 changed files with 293 additions and 465 deletions.
145 changes: 71 additions & 74 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,62 +33,59 @@ jobs:
name: cppcheck-results
path: cppcheck-results.log
- name: get-dependencies
if: success()
run: |
sudo apt update
sudo apt install libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev linux-headers-$(uname -r) gcc gcc-multilib g++ g++-multilib cmake linux-headers-$(uname -r) build-essential valgrind
- name: prepare-dsn
if: success()
run: |
# TODO: This is broken, needs to be fixed
sudo mv ./src/IntegrationTests/ITODBCConnection/odbc-linux.ini /home/runner/odbc.ini
sudo mv ./src/IntegrationTests/ITODBCConnection/odbcinst-linux.ini /home/runner/odbcinst.ini
mkdir ${{ github.workspace }}/odbc-logs
export ODBCSYSINI=/home/runner
sudo mv ./src/IntegrationTests/ITODBCConnection/odbc-linux.ini /etc/odbc.ini
sudo mv ./src/IntegrationTests/ITODBCConnection/odbcinst-linux.ini /etc/odbcinst.ini
mkdir /home/runner/work/timestream-odbc/timestream-odbc/odbc-logs
export ODBCSYSINI=/etc/
export ODBCINSTINI=odbcinst.ini
export ODBCINI=/home/runner/odbc.ini
printenv ODBCSYSINI ODBCINSTINI ODBCINI
odbcinst -q -d
odbcinst -q -s
odbcinst -j
cat /home/runner/odbc.ini
cat /home/runner/odbcinst.ini
export ODBCINI=/etc/odbc.ini
- name: configure-and-build-driver
run: |
./build_linux_release64_rpm.sh
- name: configure-aws-credentials
if: success()
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: run-connection-unit-test
if: success()
run: |
./build/odbc/bin/ut_conn
- name: run-integration-connection-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_connection
- name: run-integration-execution-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_execution
- name: run-integration-results-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_results
- name: run-integration-descriptors-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_descriptors
- name: run-integration-catalog-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_catalog
- name: run-integration-info-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_info
- name: run-integration-pagination-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_pagination
- name: prepare-test-results
Expand All @@ -102,52 +99,53 @@ jobs:
name: integration-test-results-linux64
path: |
${{ github.workspace }}/odbc-logs/
- name: build-installer-rpm
if: always()
- name: build-rpm-installer
if: success()
run: |
./build_linux_release64_rpm.sh
cd cmake-build64
cmake ../src
make
make -j4
cpack .
cd ..
- name: build-installer-deb
if: always()
- name: build-deb-installer
if: success()
run: |
./build_linux_release64_deb.sh
cd cmake-build64
cmake ../src
make
make -j4
cpack .
cd ..
- name: create-output
if: success()
run: |
mkdir build-output
mkdir test-output
mkdir rpm-installer
mkdir deb-installer
cp ./build/odbc/lib/*.so build-output/
cp ./build/odbc/lib/*.a build-output/
cp ./cmake-build64/*.rpm rpm-installer/
cp ./cmake-build64/*.deb deb-installer/
mkdir build-output
mkdir test-output
cp -v ./build/odbc/lib/*.a build-output/
cp -v ./build/odbc/lib/*.so build-output/
cp -v ./cmake-build64/*.rpm rpm-installer/
cp -v ./cmake-build64/*.deb deb-installer/
- name: upload-build
if: success()
uses: actions/upload-artifact@v2
with:
name: linux64-build
path: build-output
- name: upload-linux64-installer-rpm
- name: upload-linux64-rpm-installer
if: success()
uses: actions/upload-artifact@v2
with:
name: linux64-installer-rpm
path: installer-rpm
- name: upload-linux64-installer-deb
name: linux64-rpm-installer
path: rpm-installer
- name: upload-linux64-deb-installer
if: success()
uses: actions/upload-artifact@v2
with:
name: linux64-installer-deb
path: installer-deb
name: linux64-deb-installer
path: deb-installer
build-linux32:
runs-on: ubuntu-latest
steps:
Expand All @@ -163,64 +161,62 @@ jobs:
name: cppcheck-results
path: cppcheck-results.log
- name: get-dependencies
if: success()
run: |
# Need to install i386 versions
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install unixodbc-dev:i386 odbcinst1debian2:i386 libodbc1:i386 libcurl4-openssl-dev:i386 libssl-dev:i386 uuid-dev:i386 cpp:i386 cpp-9:i386 gcc:i386 g++:i386 zlib1g-dev:i386 linux-headers-$(uname -r) gcc-multilib:i386 g++-multilib:i386 cmake g++-9:i386 gcc-9:i386 gcc-9-multilib:i386 g++-9-multilib:i386 binutils:i386 make:i386
- name: prepare-dsn
if: success()
run: |
# TODO: This is broken, needs to be
sudo mv ./src/IntegrationTests/ITODBCConnection/odbc-linux.ini /home/runner/odbc.ini
sudo mv ./src/IntegrationTests/ITODBCConnection/odbcinst-linux.ini /home/runner/odbcinst.ini
mkdir ${{ github.workspace }}/odbc-logs
export ODBCSYSINI=/home/runner
sudo mv ./src/IntegrationTests/ITODBCConnection/odbc-linux.ini /etc/odbc.ini
sudo mv ./src/IntegrationTests/ITODBCConnection/odbcinst-linux.ini /etc/odbcinst.ini
mkdir /home/runner/work/timestream-odbc/timestream-odbc/odbc-logs
export ODBCSYSINI=/etc/
export ODBCINSTINI=odbcinst.ini
export ODBCINI=/home/runner/odbc.ini
printenv ODBCSYSINI ODBCINSTINI ODBCINI
odbcinst -q -d
odbcinst -q -s
odbcinst -j
cat /home/runner/odbc.ini
cat /home/runner/odbcinst.ini
export ODBCINI=/etc/odbc.ini
- name: configure-aws-credentials
if: success()
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: configure-and-build-driver
if: success()
run: |
./build_linux_release32_rpm.sh
- name: run-connection-unit-test
if: success()
run: |
./build/odbc/bin/ut_conn
- name: run-integration-connection-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_connection
- name: run-integration-execution-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_execution
- name: run-integration-results-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_results
- name: run-integration-descriptors-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_descriptors
- name: run-integration-catalog-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_catalog
- name: run-integration-info-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_info
- name: run-integration-pagination-tests
if: always()
if: success()
run: |
./build/odbc/bin/itodbc_pagination
- name: prepare-test-results
Expand All @@ -234,49 +230,50 @@ jobs:
name: integration-test-results-linux32
path: |
${{ github.workspace }}/odbc-logs/
- name: build-installer-rpm
if: always()
- name: build-rpm-installer
if: success()
run: |
./build_linux_release32_rpm.sh
cd cmake-build32
cmake ../src
make
make -j4
cpack .
cd ..
- name: build-installer-deb
if: always()
- name: build-deb-installer
if: success()
run: |
./build_linux_release32_deb.sh
cd cmake-build32
cmake ../src
make
make -j4
cpack .
cd ..
- name: create-output
if: success()
run: |
mkdir build-output
mkdir test-output
mkdir rpm-installer
mkdir deb-installer
cp ./build/odbc/lib/*.so build-output/
cp ./build/odbc/lib/*.a build-output/
cp ./cmake-build32/*.rpm rpm-installer/
cp ./cmake-build32/*.deb deb-installer/
mkdir build-output
mkdir test-output
cp -v ./build/odbc/lib/*.a build-output/
cp -v ./build/odbc/lib/*.so build-output/
cp -v ./cmake-build32/*.rpm rpm-installer/
cp -v ./cmake-build32/*.deb deb-installer/
- name: upload-build
if: success()
uses: actions/upload-artifact@v2
with:
name: linux32-build
path: build-output
- name: upload-linux32-installer-rpm
- name: upload-linux32-rpm-installer
if: success()
uses: actions/upload-artifact@v2
with:
name: linux32-installer-rpm
path: installer-rpm
- name: upload-linux32-installer-deb
name: linux32-rpm-installer
path: rpm-installer
- name: upload-linux32-deb-installer
if: success()
uses: actions/upload-artifact@v2
with:
name: linux32-installer-deb
path: installer-deb
name: linux32-deb-installer
path: deb-installer
3 changes: 0 additions & 3 deletions .github/workflows/mac-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ jobs:
cp ./build/odbc/lib/*.dylib build-output/
cp ./build/odbc/lib/*.a build-output/
cp ./cmake-build64/*.pkg installer/
# cp $(ls -d ./build/odbc/bin/* | grep -v "\.") build-output
# cp ./bin64/*.html test-output
# cp ./bin64/*.log test-output
- name: upload-build
if: success()
uses: actions/upload-artifact@v2
Expand Down
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ endif()
# Set BUILD_WITH_TESTS to OFF before building installer package for size optimization.
option(BUILD_WITH_TESTS "Enable testing" ON)

# Do not under any circumstance reduce or remove the compiler warning flags.
# These are our (best) friends.
if(MSVC)
add_compile_options(/W4 /WX)
else()
# TODO: add -Werror once all warnings are resolved.
add_compile_options(-Wall -Wextra -pedantic)
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()

# Base directories
Expand Down
6 changes: 3 additions & 3 deletions src/IntegrationTests/ITODBCAwsAuth/test_odbc_aws_auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ test_string aws_auth_conn_string =
test_string(CREATE_STRING("Host=https://")) +
test_string(CREATE_STRING("search-bit-quill-cx3hpfoxvasohujxkllmgjwqde.us-west-2.")) +
test_string(CREATE_STRING("es.amazonaws.com;")) +
test_string(CREATE_STRING("Auth=IAM;Region=us-west-2;LogLevel=1"));
test_string(CREATE_STRING("Auth=IAM;Region=us-west-2;LogLevel=3"));
test_string aws_auth_conn_string_invalid_region =
test_string(CREATE_STRING("Driver={Elasticsearch};DataBase=database_name;")) +
test_string(CREATE_STRING("Host=https://")) +
test_string(CREATE_STRING("search-bit-quill-cx3hpfoxvasohujxkllmgjwqde.us-west-2.")) +
test_string(CREATE_STRING("es.amazonaws.com;")) +
test_string(CREATE_STRING("Auth=IAM;Region=us-west-3;LogLevel=1"));
test_string(CREATE_STRING("Auth=IAM;Region=us-west-3;LogLevel=3"));
test_string aws_auth_conn_string_invalid_authtype =
test_string(CREATE_STRING("Driver={Elasticsearch};DataBase=database_name;")) +
test_string(CREATE_STRING("Host=https://")) +
test_string(CREATE_STRING("search-bit-quill-cx3hpfoxvasohujxkllmgjwqde.us-west-2.")) +
test_string(CREATE_STRING("es.amazonaws.com;")) +
test_string(CREATE_STRING("Auth=AWS;Region=us-west-2;LogLevel=1"));
test_string(CREATE_STRING("Auth=AWS;Region=us-west-2;LogLevel=3"));

class TestAwsAuthConnection : public testing::Test {
public:
Expand Down
22 changes: 12 additions & 10 deletions src/IntegrationTests/ITODBCCatalog/test_odbc_catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,18 @@ class TestSQLGetTypeInfo : public Fixture {};
// SQLHSTMT m_hstmt = SQL_NULL_HSTMT;
//};

//#define TEST_SQL_KEYS(test_name, test_function, ...) \
// TEST_F(TestSQLCatalogKeys, test_name) { \
// EXPECT_TRUE(SQL_SUCCEEDED(test_function(m_hstmt, __VA_ARGS__))); \
// size_t result_count = 0; \
// SQLRETURN ret; \
// while ((ret = SQLFetch(m_hstmt)) == SQL_SUCCESS) \
// result_count++; \
// EXPECT_EQ(ret, SQL_NO_DATA); \
// EXPECT_EQ(result_count, static_cast< size_t >(0)); \
// }
/*
#define TEST_SQL_KEYS(test_name, test_function, ...) \
TEST_F(TestSQLCatalogKeys, test_name) { \
EXPECT_TRUE(SQL_SUCCEEDED(test_function(m_hstmt, __VA_ARGS__))); \
size_t result_count = 0; \
SQLRETURN ret; \
while ((ret = SQLFetch(m_hstmt)) == SQL_SUCCESS) \
result_count++; \
EXPECT_EQ(ret, SQL_NO_DATA); \
EXPECT_EQ(result_count, static_cast< size_t >(0)); \
}
*/

/**
* SQLTables Tests
Expand Down
8 changes: 4 additions & 4 deletions src/IntegrationTests/ITODBCConnection/odbc-linux.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[ODBC Data Sources]
timestream-iam = timestream
timestream-aws-profile = timestream
timestream-iam = timestreamodbc
timestream-aws-profile = timestreamodbc

[timestream-iam]
Driver = /usr/lib/odfe-sql-odbc/lib/libodfesqlodbc.so
Driver = timestreamodbc
Region = us-east-1
LogOutput = /home/runner/work/timestream-odbc/timestream-odbc/odbc-logs/
LogLevel = 7
Auth = IAM

[timestream-aws-profile]
Driver = /usr/lib/odfe-sql-odbc/lib/libodfesqlodbc.so
Driver = timestreamodbc
Region = us-east-1
LogOutput = /home/runner/work/timestream-odbc/timestream-odbc/odbc-logs/
LogLevel = 7
Expand Down
Loading

0 comments on commit 22972db

Please sign in to comment.