Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ updates:
interval: "monthly"


# Check individual projects in subfolders.
# Check individual projects in sub-folders.

- directory: "/by-language/csharp-npgsql" # Location of package manifests
package-ecosystem: "nuget" # See documentation for possible values
- directory: "/by-language/csharp-npgsql"
package-ecosystem: "nuget"
schedule:
interval: "monthly"

Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/test-java-jdbc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ name: Java JDBC
on:

pull_request:
branches: [ main ]
branches: ~
paths:
- '.github/workflows/test-java-jdbc.yml'
- 'by-language/java-jdbc/**'
- 'testing/ngr.py'
push:
branches: [ main ]
paths:
- '.github/workflows/test-java-jdbc.yml'
- 'by-language/java-jdbc/**'
- 'testing/ngr.py'

# Allow job to be triggered manually.
workflow_dispatch:
Expand Down Expand Up @@ -49,9 +51,6 @@ jobs:
java-version: "11"
cache: "maven"

- name: Run software tests
- name: Validate by-language/java-jdbc
run: |
cd by-language/java-jdbc
mvn install
mvn exec:java -Dexec.args="--dburl 'jdbc:postgresql://localhost:5432/'"
mvn exec:java -Dexec.args="--dburl 'jdbc:crate://localhost:5432/'"
python testing/ngr.py by-language/java-jdbc
9 changes: 5 additions & 4 deletions .github/workflows/test-java-jooq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ name: Java jOOQ
on:

pull_request:
branches: [ main ]
branches: ~
paths:
- '.github/workflows/test-java-jooq.yml'
- 'by-language/java-jooq/**'
- 'testing/ngr.py'
push:
branches: [ main ]
paths:
- '.github/workflows/test-java-jooq.yml'
- 'by-language/java-jooq/**'
- 'testing/ngr.py'

# Allow job to be triggered manually.
workflow_dispatch:
Expand Down Expand Up @@ -49,7 +51,6 @@ jobs:
java-version: "17"
cache: "gradle"

- name: Run software tests
- name: Validate by-language/java-jooq
run: |
cd by-language/java-jooq
./gradlew check
python testing/ngr.py by-language/java-jooq
44 changes: 13 additions & 31 deletions .github/workflows/test-npgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ on:
paths:
- '.github/workflows/*npgsql*'
- 'by-language/csharp-npgsql/**'
- 'testing/ngr.py'
pull_request:
branches: [ main ]
branches: ~
paths:
- '.github/workflows/*npgsql*'
- 'by-language/csharp-npgsql/**'
- 'testing/ngr.py'

# Allow job to be triggered manually.
workflow_dispatch:
Expand All @@ -29,22 +31,22 @@ concurrency:
defaults:
run:
shell: bash
working-directory: by-language/csharp-npgsql

jobs:
test:
name: "CrateDB: ${{ matrix.cratedb-version }}
name: "
Npgsql: ${{ matrix.npgsql-version }}
.NET: ${{ matrix.dotnet-version }}
CrateDB: ${{ matrix.cratedb-version }}
on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] # , macos-latest
dotnet-version: ['5.0.x', '6.0.x', '7.0.x']
cratedb-version: ['nightly']
npgsql-version: ['6.0.9', '7.0.6']
fail-fast: false

# https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers
services:
Expand All @@ -63,35 +65,15 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Use Npgsql version ${{ matrix.npgsql-version }}
run: |
sed -E 's!<PackageReference Include="Npgsql" Version=".+?" />!<PackageReference Include="Npgsql" Version="${{ matrix.npgsql-version }}" />!' \
-i demo.csproj

- name: Display .NET information
run: |
dotnet --version
dotnet --info

- name: Display package information
run: |
dotnet restore
dotnet list . package

- name: Invoke tests on .NET 5
if: matrix.dotnet-version == '5.0.x'
run: |
dotnet test --framework=net5.0 --collect:"XPlat Code Coverage"

- name: Invoke tests on .NET 6
if: matrix.dotnet-version == '6.0.x'
run: |
dotnet test --framework=net6.0 --collect:"XPlat Code Coverage"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: x64

- name: Invoke tests on .NET 7
if: matrix.dotnet-version == '7.0.x'
- name: Validate by-language/csharp-npgsql, Npgsql ${{ matrix.npgsql-version }}
run: |
dotnet test --framework=net7.0 --collect:"XPlat Code Coverage"
python testing/ngr.py by-language/csharp-npgsql --npgsql-version=${{ matrix.npgsql-version }}

# https://github.com/codecov/codecov-action
- name: Upload coverage results to Codecov
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-php-amphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ name: PHP AMPHP
on:

pull_request:
branches: [ main ]
branches: ~
paths:
- '.github/workflows/test-php-amphp.yml'
- 'by-language/php-amphp/**'
- 'testing/ngr.py'
push:
branches: [ main ]
paths:
- '.github/workflows/test-php-amphp.yml'
- 'by-language/php-amphp/**'
- 'testing/ngr.py'

# Allow job to be triggered manually.
workflow_dispatch:
Expand Down Expand Up @@ -52,8 +54,6 @@ jobs:
php-version: ${{ matrix.php-version }}
tools: composer

- name: Run software tests
- name: Validate by-language/php-amphp
run: |
cd by-language/php-amphp
composer install
php basic.php 'host=localhost port=5432 user=crate'
python testing/ngr.py by-language/php-amphp
9 changes: 5 additions & 4 deletions .github/workflows/test-php-pdo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ name: PHP PDO
on:

pull_request:
branches: [ main ]
branches: ~
paths:
- '.github/workflows/test-php-pdo.yml'
- 'by-language/php-pdo/**'
- 'testing/ngr.py'
push:
branches: [ main ]
paths:
- '.github/workflows/test-php-pdo.yml'
- 'by-language/php-pdo/**'
- 'testing/ngr.py'

# Allow job to be triggered manually.
workflow_dispatch:
Expand Down Expand Up @@ -52,7 +54,6 @@ jobs:
php-version: ${{ matrix.php-version }}
extensions: pdo_pgsql

- name: Run software tests
- name: Validate by-language/php-pdo
run: |
cd by-language/php-pdo
php basic.php 'pgsql:host=localhost;port=5432;user=crate'
python testing/ngr.py by-language/php-pdo
11 changes: 5 additions & 6 deletions .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ name: Ruby
on:

pull_request:
branches: [ main ]
branches: ~
paths:
- '.github/workflows/test-ruby.yml'
- 'by-language/ruby/**'
- 'testing/ngr.py'
push:
branches: [ main ]
paths:
- '.github/workflows/test-ruby.yml'
- 'by-language/ruby/**'
- 'testing/ngr.py'

# Allow job to be triggered manually.
workflow_dispatch:
Expand Down Expand Up @@ -55,9 +57,6 @@ jobs:
if: ${{ matrix.ruby-version == 'jruby' }}
run: sudo apt-get update && sudo apt-get install --yes build-essential libpq-dev

- name: Run software tests
- name: Validate by-language/ruby
run: |
cd by-language/ruby
bundle install
ruby ruby_example.rb crate_ruby
ruby ruby_example.rb pg
python testing/ngr.py by-language/ruby
9 changes: 5 additions & 4 deletions .github/workflows/testcontainers-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ name: Testcontainers for Java
on:

pull_request:
branches: [ main ]
branches: ~
paths:
- '.github/workflows/testcontainers-java.yml'
- 'testing/testcontainers/java/**'
- 'testing/ngr.py'
push:
branches: [ main ]
paths:
- '.github/workflows/testcontainers-java.yml'
- 'testing/testcontainers/java/**'
- 'testing/ngr.py'

# Allow job to be triggered manually.
workflow_dispatch:
Expand Down Expand Up @@ -41,7 +43,6 @@ jobs:
java-version: "17"
cache: "gradle"

- name: Run software tests
- name: Validate testing/testcontainers/java
run: |
cd testing/testcontainers/java
./gradlew check
python testing/ngr.py testing/testcontainers/java
26 changes: 25 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################
CrateDB examples
CrateDB Examples
################


Expand Down Expand Up @@ -30,4 +30,28 @@ Layout
different kinds of test layers for testing your applications with CrateDB.


*******
Testing
*******

The repository includes an universal test runner, which can be used to invoke
test suites of different languages and environments.

Examples::

python testing/ngr.py by-language/csharp-npgsql
python testing/ngr.py by-language/csharp-npgsql --npgsql-version=6.0.9
python testing/ngr.py by-language/java-jdbc
python testing/ngr.py by-language/java-jooq
python testing/ngr.py by-language/php-amphp
python testing/ngr.py by-language/php-pdo
python testing/ngr.py by-language/python-sqlalchemy
python testing/ngr.py by-language/ruby

More examples::

python testing/ngr.py testing/testcontainers/java

It is recommended to invoke ``ngr`` from within a Python virtualenv.

.. _CrateDB: https://github.com/crate/crate
3 changes: 3 additions & 0 deletions by-language/java-jdbc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test:
mvn exec:java -Dexec.args="--dburl 'jdbc:postgresql://localhost:5432/'"
mvn exec:java -Dexec.args="--dburl 'jdbc:crate://localhost:5432/'"
5 changes: 4 additions & 1 deletion by-language/php-amphp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Crate.io",
"email": "office@crate.io",
"homepage": "https://crate.io",
"homepage": "https://cratedb.com/",
"role": "maintainer"
}
],
Expand All @@ -15,5 +15,8 @@
"require": {
"php": "^7.1|^8.0|^8.1|^8.2",
"amphp/postgres": "^1.4"
},
"scripts": {
"test": "php basic.php 'host=localhost port=5432 user=crate'"
}
}
1 change: 1 addition & 0 deletions by-language/php-pdo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor
21 changes: 21 additions & 0 deletions by-language/php-pdo/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "crate/pdo-pgsql-example",
"description": "PDO_PGSQL example for CrateDB",
"authors": [
{
"name": "Crate.io",
"email": "office@crate.io",
"homepage": "https://cratedb.com/",
"role": "maintainer"
}
],
"license": "Apache-2.0",
"homepage": "https://github.com/crate/cratedb-examples/tree/main/by-language/php-pdo",
"keywords": ["database", "cratedb", "sql", "postgresql"],
"require": {
"php": "^7.1|^8.0|^8.1|^8.2"
},
"scripts": {
"test": "php basic.php 'pgsql:host=localhost;port=5432;user=crate'"
}
}
20 changes: 20 additions & 0 deletions by-language/php-pdo/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions by-language/ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ source 'https://rubygems.org'

gem 'crate_ruby', '<1'
gem 'pg', '<2'
gem 'rake', '<14'
6 changes: 6 additions & 0 deletions by-language/ruby/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
task default: %w[test]

task :test do
ruby "ruby_example.rb crate_ruby"
ruby "ruby_example.rb pg"
end
Loading