Skip to content

Commit 670a719

Browse files
SingleStore support (#3)
Authored-by: Olha Kramarenko <[email protected]> Co-authored-by: Pavlo Mishchenko <[email protected]>
1 parent 01c6941 commit 670a719

File tree

1,003 files changed

+67482
-61081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,003 files changed

+67482
-61081
lines changed

.circleci/config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Data": {
3+
"ConnectionString": "server=SINGLESTORE_HOST;user id=SQL_USER_NAME;password=SQL_USER_PASSWORD;port=3306;database=singlestoretest;convert zero datetime=True",
4+
"ServerVersion": "auto",
5+
"CommandTimeout": "600"
6+
}
7+
}
8+

.circleci/config.yml

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
version: 2.1
2+
parameters:
3+
dotnet-version:
4+
type: string
5+
default: "6.0.200"
6+
7+
orbs:
8+
win: circleci/[email protected]
9+
10+
commands:
11+
setup-environment-ubuntu:
12+
description: Setup Linux environment
13+
steps:
14+
- run:
15+
name: Install .NET Core 6.0
16+
command: |
17+
wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
18+
sudo dpkg -i packages-microsoft-prod.deb
19+
rm packages-microsoft-prod.deb
20+
sudo apt-get update
21+
sudo apt-get install -y apt-transport-https
22+
sudo apt-get update
23+
sudo apt-get install -y mariadb-client-core-10.3
24+
sudo apt-get install -y dotnet-sdk-6.0
25+
dotnet --info
26+
- run:
27+
name: Install Powershell
28+
command: |
29+
sudo snap install powershell --classic
30+
copy-config:
31+
parameters:
32+
test-block:
33+
type: string
34+
steps:
35+
- run:
36+
name: "Copy config file for << parameters.test-block >>"
37+
command: |
38+
cp ./.circleci/config.json test/<< parameters.test-block >>/config.json
39+
sed -i "s|SINGLESTORE_HOST|127.0.0.1|g" test/<< parameters.test-block >>/config.json
40+
sed -i "s|SQL_USER_PASSWORD|${SQL_USER_PASSWORD}|g" test/<< parameters.test-block >>/config.json
41+
sed -i "s|SQL_USER_NAME|root|g" test/<< parameters.test-block >>/config.json
42+
copy-config-for-all:
43+
steps:
44+
- copy-config:
45+
test-block: EFCore.SingleStore.Tests
46+
- copy-config:
47+
test-block: EFCore.SingleStore.IntegrationTests
48+
- copy-config:
49+
test-block: EFCore.SingleStore.FunctionalTests
50+
run-test-block:
51+
parameters:
52+
test-block:
53+
type: string
54+
steps:
55+
- run:
56+
name: "Run << parameters.test-block >> "
57+
command: |
58+
cd test/<< parameters.test-block >>
59+
dotnet test -f net6.0 -c Release --no-build
60+
cd ../../
61+
run-tests-win:
62+
description: Run tests on Windows
63+
parameters:
64+
target_framework:
65+
type: string
66+
func_test_block_path:
67+
type: string
68+
steps:
69+
- run:
70+
name: EFCore.SingleStore.Tests
71+
command: |
72+
.\.circleci\run-test-windows.ps1 -test_block EFCore.SingleStore.Tests -target_framework << parameters.target_framework >>
73+
- run:
74+
name: Rebuild all migrations for Integration tests
75+
command: |
76+
.\test\EFCore.SingleStore.IntegrationTests\scripts\rebuild.ps1
77+
- run:
78+
name: EFCore.SingleStore.IntegrationTests
79+
command: |
80+
.\.circleci\run-test-windows.ps1 -test_block EFCore.SingleStore.IntegrationTests -target_framework << parameters.target_framework >>
81+
- run:
82+
name: EFCore.SingleStore.FunctionalTests
83+
command: |
84+
<< parameters.func_test_block_path >>
85+
change-git-repo-version:
86+
steps:
87+
- run:
88+
name: Change Git repository format version
89+
command: |
90+
git config core.repositoryformatversion 0
91+
92+
jobs:
93+
test-ubuntu:
94+
parameters:
95+
singlestore_image:
96+
type: string
97+
machine:
98+
image: ubuntu-2004:202104-01
99+
docker_layer_caching: true
100+
environment:
101+
SINGLESTORE_IMAGE: << parameters.singlestore_image >>
102+
steps:
103+
- checkout
104+
- setup-environment-ubuntu
105+
- change-git-repo-version
106+
- run:
107+
name: Start SingleStore for tests
108+
command: |
109+
./.circleci/setup_cluster.sh
110+
- copy-config-for-all
111+
- run:
112+
name: Build provider
113+
command: |
114+
dotnet build SingleStore.EFCore.sln -c Release
115+
- run-test-block:
116+
test-block: EFCore.SingleStore.Tests
117+
- run:
118+
name: Rebuild all migrations for Integration tests
119+
command: |
120+
./test/EFCore.SingleStore.IntegrationTests/scripts/rebuild.ps1
121+
- run-test-block:
122+
test-block: EFCore.SingleStore.IntegrationTests
123+
- run:
124+
name: Run EFCore.SingleStore.FunctionalTests
125+
command: |
126+
./.circleci/run_functional_tests.sh
127+
128+
129+
test-windows:
130+
parameters:
131+
func_test_block_path:
132+
type: string
133+
executor: win/default
134+
steps:
135+
- checkout
136+
- change-git-repo-version
137+
- run:
138+
name: Start SingleStore for tests
139+
command: |
140+
pip install singlestoredb
141+
python.exe .circleci\s2ms_cluster.py start singlestoretest
142+
- run:
143+
name: Fill test configs
144+
command: |
145+
python.exe .circleci\fill_test_config.py EFCore.SingleStore.Tests
146+
python.exe .circleci\fill_test_config.py EFCore.SingleStore.IntegrationTests
147+
python.exe .circleci\fill_test_config.py EFCore.SingleStore.FunctionalTests
148+
- run:
149+
name: Build project binaries
150+
command: |
151+
choco install dotnet-sdk --version=<< pipeline.parameters.dotnet-version >>
152+
dotnet.exe build SingleStore.EFCore.sln -c Release
153+
- run-tests-win:
154+
target_framework: net6.0
155+
func_test_block_path: << parameters.func_test_block_path >>
156+
- run:
157+
name: Terminate test cluster
158+
when: always
159+
command: python.exe .circleci\s2ms_cluster.py terminate
160+
161+
publish-windows:
162+
executor: win/default
163+
steps:
164+
- checkout
165+
- run:
166+
name: Build project binaries
167+
command: |
168+
choco install dotnet-sdk --version=<< pipeline.parameters.dotnet-version >>
169+
dotnet.exe build .\src\EFCore.SingleStore\EFCore.SingleStore.csproj -c Release
170+
- run:
171+
name: Creating CI Artifacts directory
172+
command: |
173+
mkdir \efcore_provider
174+
- run:
175+
name: Build NuGet packages
176+
command: |
177+
dotnet pack --output \efcore_provider .\src\EFCore.SingleStore\EFCore.SingleStore.csproj
178+
- store_artifacts:
179+
path: \efcore_provider
180+
181+
workflows:
182+
version: 2
183+
build_and_test:
184+
jobs:
185+
- test-ubuntu:
186+
name: Test 8.1 cluster-in-a-box
187+
matrix:
188+
parameters:
189+
singlestore_image:
190+
- singlestore/cluster-in-a-box:alma-8.1.30-e0a67e68e5-4.0.16-1.17.6
191+
- test-ubuntu:
192+
name: Test 8.5 cluster-in-a-box
193+
matrix:
194+
parameters:
195+
singlestore_image:
196+
- singlestore/cluster-in-a-box:alma-8.5.6-b51bc5471a-4.0.17-1.17.8
197+
- test-windows:
198+
name: Test first block of functional tests S2MS on Windows
199+
func_test_block_path: .\.circleci\run-functional-tests1.ps1
200+
- test-windows:
201+
name: Test second block of functional tests S2MS on Windows
202+
func_test_block_path: .\.circleci\run-functional-tests2.ps1
203+
204+
205+
publish:
206+
jobs:
207+
- publish-windows:
208+
filters:
209+
tags:
210+
only: /.*/
211+
branches:
212+
ignore: /.*/

.circleci/fill_test_config.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import json
2+
import os
3+
import sys
4+
from s2ms_cluster import WORKSPACE_ENDPOINT_FILE
5+
6+
7+
if __name__ == "__main__":
8+
9+
home_dir = os.getenv("HOMEPATH")
10+
if home_dir is None:
11+
home_dir = os.getenv("HOME")
12+
13+
with open(WORKSPACE_ENDPOINT_FILE, "r") as f:
14+
hostname = f.read()
15+
password = os.getenv("SQL_USER_PASSWORD")
16+
17+
with open("./.circleci/config.json", "r") as f_in:
18+
config_content = json.load(f_in)
19+
20+
config_content["Data"]["ConnectionString"] = config_content["Data"]["ConnectionString"].replace("SINGLESTORE_HOST", hostname, 1)
21+
config_content["Data"]["ConnectionString"] = config_content["Data"]["ConnectionString"].replace("SQL_USER_PASSWORD", password, 1)
22+
config_content["Data"]["ConnectionString"] = config_content["Data"]["ConnectionString"].replace("SQL_USER_NAME", "admin", 1)
23+
24+
config_content["ManagedService"] = True
25+
26+
if len(sys.argv) < 1:
27+
print("Not enough arguments to fill the config file!")
28+
exit(1)
29+
30+
test_block = sys.argv[1]
31+
32+
with open(f"test/{test_block}/config.json", "w") as f_out:
33+
json.dump(config_content, f_out, indent=4)
34+
35+
with open(os.path.join(home_dir, "CONNECTION_STRING"), "w") as f_conn:
36+
f_conn.write(config_content["Data"]["ConnectionString"])

.circleci/run-functional-tests1.ps1

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
cd test\EFCore.SingleStore.FunctionalTests\
2+
3+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.BuiltInDataTypesSingleStoreTest.'
4+
$TOTAL_FAILURES = ($LASTEXITCODE -ne 0)
5+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.CompositeKeyEndToEndSingleStoreTest.'
6+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
7+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.ConcurrencyDetectorDisabledSingleStoreTest.'
8+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
9+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.ConcurrencyDetectorEnabledSingleStoreTest.'
10+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
11+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.ConferencePlannerSingleStoreTest.'
12+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
13+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.ConnectionInterceptionSingleStoreTestBase.'
14+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
15+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.ConnectionSettingsSingleStoreTest.'
16+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
17+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.ConnectionSingleStoreTest.'
18+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
19+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.ConvertToProviderTypesSingleStoreTest.'
20+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
21+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.CustomConvertersSingleStoreTest.'
22+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
23+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.DataAnnotationSingleStoreTest.'
24+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
25+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.DatabindingSingleStoreTest.'
26+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
27+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.DesignTimeSingleStoreTest.'
28+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
29+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.FieldMappingSingleStoreTest.'
30+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
31+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.FindSingleStoreTest.'
32+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
33+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.FullInfrastructureMigrationsTest.'
34+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
35+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.KeysWithConvertersSingleStoreTest.'
36+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
37+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.LazyLoadProxySingleStoreTest.'
38+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
39+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.LoadSingleStoreTest.'
40+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
41+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.MigrationsInfrastructureSingleStoreTest.'
42+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
43+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.MigrationsSingleStoreTest.'
44+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
45+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.MusicStoreSingleStoreTest.'
46+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
47+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindQueryTaggingQuerySingleStoreTest.'
48+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
49+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NotificationEntitiesSingleStoreTest.'
50+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
51+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.OptimisticConcurrencySingleStoreTest.'
52+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
53+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.OverzealousInitializationSingleStoreTest.'
54+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
55+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.PropertyValuesSingleStoreTest.'
56+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
57+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.SaveChangesInterceptionSingleStoreTestBase.'
58+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
59+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.SeedingSingleStoreTest.'
60+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
61+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.SerializationSingleStoreTest.'
62+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
63+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.SingleStoreApiConsistencyTest.'
64+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
65+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.SingleStoreComplianceTest.'
66+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
67+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.SingleStoreMigrationsSqlGeneratorTest.'
68+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
69+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.SingleStoreNetTopologySuiteApiConsistencyTest.'
70+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
71+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.SingleStoreServiceCollectionExtensionsTest.'
72+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
73+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.StoreGeneratedSingleStoreTest.'
74+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
75+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.TableSplittingSingleStoreTest.'
76+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
77+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.TPTTableSplittingSingleStoreTest.'
78+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
79+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.TransactionSingleStoreTest.'
80+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
81+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.TwoDatabasesSingleStoreTest.'
82+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
83+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.UpdatesSingleStoreTest.'
84+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
85+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.ValueConvertersEndToEndSingleStoreTest.'
86+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
87+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.WithConstructorsSingleStoreTest.'
88+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
89+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindNavigationsQuerySingleStoreTest.'
90+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
91+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindSplitIncludeNoTrackingQuerySingleStoreTest.'
92+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
93+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindSetOperationsQuerySingleStoreTest.'
94+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
95+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindSelectQuerySingleStoreTest.'
96+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
97+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindQueryFiltersQuerySingleStoreTest.'
98+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
99+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindMiscellaneousQuerySingleStoreTest.'
100+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
101+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindKeylessEntitiesQuerySingleStoreTest.'
102+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
103+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindJoinQuerySingleStoreTest.'
104+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
105+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindIncludeQuerySingleStoreTest.'
106+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
107+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindIncludeNoTrackingQuerySingleStoreTest.'
108+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
109+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindGroupByQuerySingleStoreTest.'
110+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
111+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindFunctionsQuerySingleStoreTest.'
112+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
113+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindDbFunctionsQuerySingleStoreTest.'
114+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
115+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindCompiledQuerySingleStoreTest.'
116+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
117+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindChangeTrackingQuerySingleStoreTest.'
118+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
119+
dotnet.exe test -f net6.0 -c Release --no-build --filter 'FullyQualifiedName~.NorthwindAsTrackingQuerySingleStoreTest.'
120+
$TOTAL_FAILURES += ($LASTEXITCODE -ne 0)
121+
122+
cd ..\..\
123+
124+
if ( $TOTAL_FAILURES -ne 0 ) {
125+
echo "Number of tests failed: ${TOTAL_FAILURES}"
126+
exit 1
127+
}
128+
else {
129+
exit 0
130+
}

0 commit comments

Comments
 (0)