Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 26 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
GOFLAGS: -mod=readonly
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with: { go-version: "${{ env.GO_VERSION }}" }
- name: "Copy language files"
Expand All @@ -38,9 +40,6 @@ jobs:
- name: "Unit"
working-directory: server
run: make test.unit
- name: "Store"
working-directory: server
run: make test.store
- name: "Integration"
working-directory: server
run: make test.integration
Expand All @@ -52,6 +51,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with: { node-version: "${{ env.NODE_VERSION }}" }
- uses: actions/cache@v3
Expand Down Expand Up @@ -89,6 +90,8 @@ jobs:
steps:
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with: { go-version: "${{ env.GO_VERSION }}" }
- name: "Restore web console dist from cache"
Expand Down Expand Up @@ -120,6 +123,8 @@ jobs:
lib: [ "js", "vue" ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with: { node-version: "${{ env.NODE_VERSION }}" }
- uses: actions/cache@v3
Expand All @@ -146,6 +151,8 @@ jobs:
lib: [ "js", "vue" ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org/'
Expand Down Expand Up @@ -190,6 +197,8 @@ jobs:
needs: [ "lib-build-and-publish" ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with: { node-version: "${{ env.NODE_VERSION }}" }
- name: "Setup YARN"
Expand Down Expand Up @@ -223,6 +232,8 @@ jobs:
steps:
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with: { node-version: "${{ env.NODE_VERSION }}" }
- name: "Setup YARN"
Expand Down Expand Up @@ -261,6 +272,8 @@ jobs:
RELEASE_SFTP_URI: ${{ secrets.RELEASE_SFTP_URI }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: "Prepare dist dir"
run: |
Expand Down Expand Up @@ -334,6 +347,8 @@ jobs:
steps:
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Download"
run: |
curl --silent --location "${{ env.RELEASE_BASE_URL }}/corteza-server-${{ env.BUILD_VERSION }}-${{ matrix.os }}-amd64.tar.gz" | \
Expand Down Expand Up @@ -384,6 +399,8 @@ jobs:
steps:
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with: { go-version: "${{ env.GO_VERSION }}" }
- name: "Copy essentials"
Expand Down Expand Up @@ -419,6 +436,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Parse version tag"
id: version
run: |
Expand Down Expand Up @@ -469,6 +488,8 @@ jobs:
needs: [ docker-images, release ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Parse version tag"
id: version
run: |
Expand Down Expand Up @@ -503,6 +524,8 @@ jobs:
needs: [ notify ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create Sentry release
uses: getsentry/action-release@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jobs:
- name: Checkout corteza repo
uses: actions/checkout@v3
with:
fetch-depth: 0
path: corteza
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.ref_name }}
Expand Down
81 changes: 79 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
lib: [ "js", "vue" ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with: { node-version: "${{ env.NODE_VERSION }}" }
- uses: actions/cache@v3
Expand All @@ -56,6 +58,8 @@ jobs:
matrix: { app: [ admin, compose, discovery, privacy, reporter, one, workflow ] }
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with: { node-version: "${{ env.NODE_VERSION }}" }
- name: "Setup YARN"
Expand All @@ -80,23 +84,96 @@ jobs:
runs-on: ubuntu-22.04
env:
GOFLAGS: -mod=readonly
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: corteza
POSTGRES_PASSWORD: corteza
POSTGRES_DB: corteza_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: corteza
MYSQL_DATABASE: corteza_test
MYSQL_USER: corteza
MYSQL_PASSWORD: corteza
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
ports:
- 3306:3306
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
SA_PASSWORD: Corteza123!
ACCEPT_EULA: Y
MSSQL_PID: Express
options: >-
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P Corteza123! -C -Q 'SELECT 1'"
--health-interval=15s
--health-timeout=10s
--health-retries=5
ports:
- 1433:1433
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with: { go-version: "${{ env.GO_VERSION }}" }
- name: "Copy language files"
working-directory: server/pkg/locale
run: make src/en
- name: "Wait for databases"
run: |
# Wait a bit longer for SQL Server to fully initialize
sleep 30
# Test connections (wait for all databases to be ready)
until docker exec $(docker ps -qf "ancestor=postgres:15") pg_isready; do sleep 1; done
until docker exec $(docker ps -qf "ancestor=mysql:8.0") mysqladmin ping -h localhost --silent; do sleep 1; done
until docker exec $(docker ps -qf "ancestor=mcr.microsoft.com/mssql/server:2019-latest") /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'Corteza123!' -C -Q 'SELECT 1'; do sleep 1; done
- name: "Create SQL Server test database"
run: |
# Create the corteza_test database in SQL Server
docker exec $(docker ps -qf "ancestor=mcr.microsoft.com/mssql/server:2019-latest") /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'Corteza123!' -C -Q 'CREATE DATABASE corteza_test;'
- name: "Unit"
working-directory: server
run: make test.unit
- name: "Store"
- name: "Store - SQLite"
working-directory: server
env:
RDBMS_SQLITE_DSN: "sqlite3://file::memory:?cache=shared&mode=memory"
run: go test -v ./store/tests/... -run Test_RDBMS_SQLITE
- name: "Store - PostgreSQL"
working-directory: server
run: make test.store
env:
RDBMS_PGSQL_DSN: "postgres://corteza:corteza@localhost:5432/corteza_test?sslmode=disable"
run: go test -v ./store/tests/... -run Test_RDBMS_PGSQL
- name: "Store - MySQL"
working-directory: server
env:
RDBMS_MYSQL_DSN: "mysql://corteza:corteza@tcp(localhost:3306)/corteza_test"
run: go test -v ./store/tests/... -run Test_RDBMS_MYSQL
- name: "Store - SQL Server 2019"
working-directory: server
env:
RDBMS_SQLSERVER_2019_DSN: "sqlserver://sa:Corteza123!@localhost:1433?database=corteza_test"
run: go test -v ./store/tests/... -run Test_RDBMS_SQLSERVER_2019
- name: "Integration"
working-directory: server
run: make test.integration


notify:
if: failure()
name: "Send matrix testing notification"
Expand Down
3 changes: 3 additions & 0 deletions server/store/tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"testing"
"time"

"github.com/cortezaproject/corteza/server/pkg/cli"
"github.com/cortezaproject/corteza/server/pkg/id"
"github.com/cortezaproject/corteza/server/store"
"github.com/cortezaproject/corteza/server/store/adapters/rdbms/drivers/mssql"
"github.com/cortezaproject/corteza/server/store/adapters/rdbms/drivers/mysql"
Expand All @@ -25,6 +27,7 @@ var (

func init() {
helpers.RecursiveDotEnvLoad()
id.Init(cli.Context())
}

func Test_RDBMS_SQLITE(t *testing.T) {
Expand Down
Loading