Skip to content

Commit

Permalink
SNOW-896752 - Add node20 on Ubuntu to github action tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pmotacki committed Sep 27, 2023
1 parent 8d48548 commit b9a172f
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 119 deletions.
209 changes: 91 additions & 118 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,130 +41,103 @@ jobs:
name: artifacts
path: artifacts

# test-mac:
# needs: build
# name: Tests on Mac
# runs-on: macos-latest
# strategy:
# fail-fast: false
# matrix:
# cloud: [ 'AWS' ]
# nodeVersion: [ '20.x']
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.nodeVersion }}
# - uses: actions/setup-python@v1
# with:
# python-version: '3.7'
# - name: Download Build Artifacts
# uses: actions/download-artifact@v1
# with:
# name: artifacts
# - name: Install Homebrew Bash
# shell: bash
# run: brew install bash
# - name: Tests
# shell: bash
# env:
# PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
# CLOUD_PROVIDER: ${{ matrix.cloud }}
# run: /usr/local/bin/bash ./ci/test_mac.sh
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# with:
# # without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
# token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
# fail_ci_if_error: true
#
# test-windows:
# needs: build
# name: Tests on Windows
# runs-on: windows-latest
# strategy:
# fail-fast: false
# matrix:
# cloud: [ 'AWS' ]
# nodeVersion: [ '20.x' ]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.nodeVersion }}
# - uses: actions/setup-python@v1
# with:
# python-version: '3.7'
# architecture: 'x64'
# - name: Download Build Artifacts
# uses: actions/download-artifact@v1
# with:
# name: artifacts
# - name: Tests
# shell: cmd
# env:
# PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
# CLOUD_PROVIDER: ${{ matrix.cloud }}
# run: ci\\test_windows.bat
#
# test-linux:
# needs: build
# name: Tests on Linux
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
## matrix:
## image: [ 'nodejs-centos7-node14', 'nodejs-centos7-fips']
## cloud: [ 'AWS', 'AZURE', 'GCP' ]
# steps:
# - uses: actions/checkout@v1
# - name: Download Build Artifacts
# uses: actions/download-artifact@v1
# with:
# name: artifacts
# - name: Tests
# shell: bash
# env:
# PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
# CLOUD_PROVIDER: ${{ matrix.cloud }}
# TARGET_DOCKER_TEST_IMAGE: ${{ matrix.image }}
# run: ./ci/test.sh
test-mac:
needs: build
name: Tests on Mac
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
cloud: [ 'AWS', 'AZURE', 'GCP' ]
nodeVersion: [ '14.x', '16.x', '18.x', '20.x']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodeVersion }}
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Download Build Artifacts
uses: actions/download-artifact@v1
with:
name: artifacts
- name: Install Homebrew Bash
shell: bash
run: brew install bash
- name: Tests
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.cloud }}
run: /usr/local/bin/bash ./ci/test_mac.sh
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
fail_ci_if_error: true

# test-ubuntu:
# needs: build
# name: Tests on Ubuntu
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# cloud: [ 'AWS']
# steps:
# - uses: actions/checkout@v1
# - name: Download Build Artifacts
# uses: actions/download-artifact@v1
# with:
# name: artifacts
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: '20.x'
# - name: Install dependencies
# run: npm install
# - name: Tests
# shell: bash
## env:
## PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
## CLOUD_PROVIDER: ${{ matrix.cloud }}
## TARGET_DOCKER_TEST_IMAGE: ${{ matrix.image }}
# run: ./ci/test.sh
test-windows:
needs: build
name: Tests on Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
cloud: [ 'AWS', 'AZURE', 'GCP' ]
nodeVersion: [ '14.x', '16.x', '18.x', '20.x']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodeVersion }}
- uses: actions/setup-python@v1
with:
python-version: '3.7'
architecture: 'x64'
- name: Download Build Artifacts
uses: actions/download-artifact@v1
with:
name: artifacts
- name: Tests
shell: cmd
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.cloud }}
run: ci\\test_windows.bat

test-linux:
needs: build
name: Tests on Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image: [ 'nodejs-centos7-node14', 'nodejs-centos7-fips']
cloud: [ 'AWS', 'AZURE', 'GCP' ]
steps:
- uses: actions/checkout@v1
- name: Download Build Artifacts
uses: actions/download-artifact@v1
with:
name: artifacts
- name: Tests
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.cloud }}
TARGET_DOCKER_TEST_IMAGE: ${{ matrix.image }}
run: ./ci/test.sh
test-ubuntu:
needs: build
name: Tests on Ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cloud: [ 'AWS']
cloud: [ 'AWS', 'AZURE', 'GCP' ]
nodeVersion: [ '14.x', '16.x', '18.x', '20.x']
steps:
- uses: actions/checkout@v1
- name: Download Build Artifacts
Expand All @@ -174,14 +147,14 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Tests
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.cloud }}
run: /usr/local/bin/bash ./ci/test_mac.sh
run: ./ci/test_ubuntu.sh


20 changes: 20 additions & 0 deletions ci/test_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -e
#
# Test NodeJS for Ubuntu
#
set -o pipefail
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $THIS_DIR/_init.sh
source $THIS_DIR/scripts/set_git_info.sh

export WORKSPACE=$GITHUB_WORKSPACE
export SOURCE_ROOT=$GITHUB_WORKSPACE
export SHOULD_GENERATE_COVERAGE_REPORT=1
export SHOULD_SKIP_PROXY_TESTS=1

python3 --version
python3 -m venv venv
source venv/bin/activate
pip3 install -U pip
pip3 install -U snowflake-connector-python
$THIS_DIR/container/test_component.sh $SHOULD_GENERATE_COVERAGE_REPORT
2 changes: 1 addition & 1 deletion test/integration/testProxyExecute.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const os = require('os');

describe('Execute proxy test', function () {
const platform = os.platform();
if (platform === 'linux') {
if (platform === 'linux' && !process.env.SHOULD_SKIP_PROXY_TESTS) {
let connection;
const createNodeTSQL = 'create or replace table NodeT(colA number, colB varchar)';
const selectAllSQL = 'select * from NodeT';
Expand Down

0 comments on commit b9a172f

Please sign in to comment.