Skip to content

Commit f771021

Browse files
RustFS and fmt
1 parent a51785d commit f771021

6 files changed

Lines changed: 86 additions & 51 deletions

File tree

.github/workflows/test.yml

Lines changed: 72 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ jobs:
8585
test-cli:
8686
name: App / CLI
8787
runs-on: ubuntu-latest
88+
services:
89+
rustfs:
90+
image: rustfs/rustfs:latest
91+
ports:
92+
- 9000:9000
93+
env:
94+
RUSTFS_ACCESS_KEY: LSIAQAAAAAAVNCBMPNSG
95+
RUSTFS_SECRET_KEY: "5555555555555555555555555555555555555555"
8896
strategy:
8997
matrix:
9098
arch: [amd64]
@@ -107,24 +115,32 @@ jobs:
107115
target-${{ runner.os }}-
108116
- name: Setup Rust Toolchain
109117
uses: ./.github/actions/setup-rust
110-
- name: Start LocalStack
111-
uses: LocalStack/setup-localstack@v0.2.3
112-
with:
113-
image-tag: 'latest'
114-
install-awslocal: 'true'
115-
configuration: DEBUG=1
116-
- name: Run Tests against LocalStack
118+
- name: Wait for RustFS
119+
run: timeout 60 bash -c 'until nc -z localhost 9000; do sleep 2; done'
120+
- name: Setup S3 buckets
121+
env:
122+
AWS_ACCESS_KEY_ID: LSIAQAAAAAAVNCBMPNSG
123+
AWS_SECRET_ACCESS_KEY: "5555555555555555555555555555555555555555"
124+
AWS_DEFAULT_REGION: us-east-1
117125
run: |
118-
awslocal s3 mb s3://test
119-
awslocal s3 mv data/aggregate_test_100.csv s3://test/
120-
awslocal s3 mb s3://tpch-db
126+
aws --endpoint-url http://localhost:9000 s3 mb s3://test
127+
aws --endpoint-url http://localhost:9000 s3 cp data/aggregate_test_100.csv s3://test/
128+
aws --endpoint-url http://localhost:9000 s3 mb s3://tpch-db
121129
echo "Test Execution complete!"
122130
- name: Run CLI tests
123131
run: |
124132
cargo test cli_cases
125133
test-tui:
126134
name: App / TUI
127135
runs-on: ubuntu-latest
136+
services:
137+
rustfs:
138+
image: rustfs/rustfs:latest
139+
ports:
140+
- 9000:9000
141+
env:
142+
RUSTFS_ACCESS_KEY: LSIAQAAAAAAVNCBMPNSG
143+
RUSTFS_SECRET_KEY: "5555555555555555555555555555555555555555"
128144
strategy:
129145
matrix:
130146
arch: [amd64]
@@ -147,17 +163,17 @@ jobs:
147163
target-${{ runner.os }}-
148164
- name: Setup Rust Toolchain
149165
uses: ./.github/actions/setup-rust
150-
- name: Start LocalStack
151-
uses: LocalStack/setup-localstack@v0.2.3
152-
with:
153-
image-tag: 'latest'
154-
install-awslocal: 'true'
155-
configuration: DEBUG=1
156-
- name: Run Tests against LocalStack
166+
- name: Wait for RustFS
167+
run: timeout 60 bash -c 'until nc -z localhost 9000; do sleep 2; done'
168+
- name: Setup S3 buckets
169+
env:
170+
AWS_ACCESS_KEY_ID: LSIAQAAAAAAVNCBMPNSG
171+
AWS_SECRET_ACCESS_KEY: "5555555555555555555555555555555555555555"
172+
AWS_DEFAULT_REGION: us-east-1
157173
run: |
158-
awslocal s3 mb s3://test
159-
awslocal s3 mv data/aggregate_test_100.csv s3://test/
160-
awslocal s3 mb s3://tpch-db
174+
aws --endpoint-url http://localhost:9000 s3 mb s3://test
175+
aws --endpoint-url http://localhost:9000 s3 cp data/aggregate_test_100.csv s3://test/
176+
aws --endpoint-url http://localhost:9000 s3 mb s3://tpch-db
161177
echo "Test Execution complete!"
162178
- name: Run TUI tests
163179
run: |
@@ -166,6 +182,14 @@ jobs:
166182
test-s3:
167183
name: Extension / S3
168184
runs-on: ubuntu-latest
185+
services:
186+
rustfs:
187+
image: rustfs/rustfs:latest
188+
ports:
189+
- 9000:9000
190+
env:
191+
RUSTFS_ACCESS_KEY: LSIAQAAAAAAVNCBMPNSG
192+
RUSTFS_SECRET_KEY: "5555555555555555555555555555555555555555"
169193
strategy:
170194
matrix:
171195
arch: [amd64]
@@ -188,16 +212,16 @@ jobs:
188212
target-${{ runner.os }}-
189213
- name: Setup Rust Toolchain
190214
uses: ./.github/actions/setup-rust
191-
- name: Start LocalStack
192-
uses: LocalStack/setup-localstack@v0.2.3
193-
with:
194-
image-tag: 'latest'
195-
install-awslocal: 'true'
196-
configuration: DEBUG=1
197-
- name: Run Tests against LocalStack
215+
- name: Wait for RustFS
216+
run: timeout 60 bash -c 'until nc -z localhost 9000; do sleep 2; done'
217+
- name: Setup S3 buckets
218+
env:
219+
AWS_ACCESS_KEY_ID: LSIAQAAAAAAVNCBMPNSG
220+
AWS_SECRET_ACCESS_KEY: "5555555555555555555555555555555555555555"
221+
AWS_DEFAULT_REGION: us-east-1
198222
run: |
199-
awslocal s3 mb s3://test
200-
awslocal s3 mv data/aggregate_test_100.csv s3://test/
223+
aws --endpoint-url http://localhost:9000 s3 mb s3://test
224+
aws --endpoint-url http://localhost:9000 s3 cp data/aggregate_test_100.csv s3://test/
201225
echo "Test Execution complete!"
202226
- name: Run S3 tests
203227
run: |
@@ -235,6 +259,14 @@ jobs:
235259
test-deltalake:
236260
name: Extension / Deltalake
237261
runs-on: ubuntu-latest
262+
services:
263+
rustfs:
264+
image: rustfs/rustfs:latest
265+
ports:
266+
- 9000:9000
267+
env:
268+
RUSTFS_ACCESS_KEY: LSIAQAAAAAAVNCBMPNSG
269+
RUSTFS_SECRET_KEY: "5555555555555555555555555555555555555555"
238270
strategy:
239271
matrix:
240272
arch: [amd64]
@@ -257,24 +289,24 @@ jobs:
257289
target-${{ runner.os }}-
258290
- name: Setup Rust Toolchain
259291
uses: ./.github/actions/setup-rust
260-
- name: Start LocalStack
261-
uses: LocalStack/setup-localstack@v0.2.3
262-
with:
263-
image-tag: 'latest'
264-
install-awslocal: 'true'
265-
configuration: DEBUG=1
266-
- name: Upload Delta Lake data to LocalStack
292+
- name: Wait for RustFS
293+
run: timeout 60 bash -c 'until nc -z localhost 9000; do sleep 2; done'
294+
- name: Upload Delta Lake data to RustFS
295+
env:
296+
AWS_ACCESS_KEY_ID: LSIAQAAAAAAVNCBMPNSG
297+
AWS_SECRET_ACCESS_KEY: "5555555555555555555555555555555555555555"
298+
AWS_DEFAULT_REGION: us-east-1
267299
run: |
268-
awslocal s3 mb s3://test
269-
awslocal s3 sync data/deltalake/simple_table s3://test/deltalake/simple_table
270-
echo "Delta Lake data uploaded to LocalStack"
300+
aws --endpoint-url http://localhost:9000 s3 mb s3://test
301+
aws --endpoint-url http://localhost:9000 s3 sync data/deltalake/simple_table s3://test/deltalake/simple_table
302+
echo "Delta Lake data uploaded to RustFS"
271303
- name: Run Deltalake tests
272304
run: |
273305
cargo test --features="deltalake s3" extension_cases::deltalake
274306
env:
275307
AWS_ACCESS_KEY_ID: LSIAQAAAAAAVNCBMPNSG
276308
AWS_SECRET_ACCESS_KEY: 5555555555555555555555555555555555555555
277-
AWS_ENDPOINT_URL: http://localhost:4566
309+
AWS_ENDPOINT_URL: http://localhost:9000
278310
AWS_REGION: us-east-1
279311
AWS_ALLOW_HTTP: true
280312
test-udfs-wasm:

src/tui/state/tabs/flightsql.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use ratatui::crossterm::event::KeyEvent;
2525
use ratatui::style::palette::tailwind;
2626
use ratatui::style::Style;
2727
use ratatui::widgets::TableState;
28-
use tokio::task::JoinHandle;
2928
use ratatui_textarea::TextArea;
29+
use tokio::task::JoinHandle;
3030

3131
use crate::config::AppConfig;
3232
use crate::tui::pagination::{extract_page, has_sufficient_rows, PAGE_SIZE};
@@ -156,7 +156,8 @@ impl FlightSQLTabState<'_> {
156156

157157
// TODO: Create Editor struct and move this there
158158
pub fn previous_word(&mut self) {
159-
self.editor.move_cursor(ratatui_textarea::CursorMove::WordBack)
159+
self.editor
160+
.move_cursor(ratatui_textarea::CursorMove::WordBack)
160161
}
161162

162163
pub fn delete_word(&mut self) {

src/tui/state/tabs/sql.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use ratatui::crossterm::event::KeyEvent;
2525
use ratatui::style::palette::tailwind;
2626
use ratatui::style::{Modifier, Style};
2727
use ratatui::widgets::TableState;
28-
use tokio::task::JoinHandle;
2928
use ratatui_textarea::TextArea;
29+
use tokio::task::JoinHandle;
3030

3131
use crate::config::AppConfig;
3232
use crate::tui::pagination::{extract_page, has_sufficient_rows, PAGE_SIZE};
@@ -220,7 +220,9 @@ impl SQLTabState<'_> {
220220
// TODO: Create Editor struct and move this there
221221
pub fn previous_word(&mut self) {
222222
match self.mode {
223-
SQLTabMode::Normal => self.editor.move_cursor(ratatui_textarea::CursorMove::WordBack),
223+
SQLTabMode::Normal => self
224+
.editor
225+
.move_cursor(ratatui_textarea::CursorMove::WordBack),
224226
SQLTabMode::DDL => self
225227
.ddl_editor
226228
.move_cursor(ratatui_textarea::CursorMove::WordBack),

tests/cli_cases/tpch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async fn test_custom_config_with_s3() {
5757
let mut config_builder = TestConfigBuilder::default();
5858
config_builder.with_db_path("s3://tpch-db/db/");
5959
let bucket = "tpch-db";
60-
let endpoint = "http://localhost:4566";
60+
let endpoint = "http://localhost:9000";
6161
let access_key = "LSIAQAAAAAAVNCBMPNSG";
6262
let secret = "5555555555555555555555555555555555555555";
6363
let allow_http = true;

tests/extension_cases/deltalake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async fn test_deltalake_s3() {
7070
"s3",
7171
"test",
7272
"s3://test",
73-
"http://localhost:4566",
73+
"http://localhost:9000",
7474
"LSIAQAAAAAAVNCBMPNSG",
7575
"5555555555555555555555555555555555555555",
7676
true,

tests/extension_cases/s3.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async fn test_s3_basic() {
3636
"s3",
3737
"test",
3838
"s3://test",
39-
"http://localhost:4566",
39+
"http://localhost:9000",
4040
"LSIAQAAAAAAVNCBMPNSG",
4141
"5555555555555555555555555555555555555555",
4242
true,
@@ -72,7 +72,7 @@ async fn test_s3_credential_chain_env_vars() {
7272
"AWS_SECRET_ACCESS_KEY",
7373
"5555555555555555555555555555555555555555",
7474
);
75-
std::env::set_var("AWS_ENDPOINT_URL_S3", "http://localhost:4566");
75+
std::env::set_var("AWS_ENDPOINT_URL_S3", "http://localhost:9000");
7676

7777
let tempdir = tempfile::tempdir().unwrap();
7878
let ddl_path = tempdir.path().join("my_ddl.sql");
@@ -88,7 +88,7 @@ async fn test_s3_credential_chain_env_vars() {
8888
"s3",
8989
"test",
9090
"s3://test",
91-
Some("http://localhost:4566"),
91+
Some("http://localhost:9000"),
9292
true,
9393
);
9494
let config = config_builder.build("my_config.toml");
@@ -124,7 +124,7 @@ async fn test_s3_credential_chain_with_static_override() {
124124
// Set wrong credentials in environment
125125
std::env::set_var("AWS_ACCESS_KEY_ID", "WRONG_KEY");
126126
std::env::set_var("AWS_SECRET_ACCESS_KEY", "WRONG_SECRET");
127-
std::env::set_var("AWS_ENDPOINT_URL_S3", "http://localhost:4566");
127+
std::env::set_var("AWS_ENDPOINT_URL_S3", "http://localhost:9000");
128128

129129
let tempdir = tempfile::tempdir().unwrap();
130130
let ddl_path = tempdir.path().join("my_ddl.sql");
@@ -143,7 +143,7 @@ async fn test_s3_credential_chain_with_static_override() {
143143
"s3",
144144
"test",
145145
"s3://test",
146-
"http://localhost:4566",
146+
"http://localhost:9000",
147147
"LSIAQAAAAAAVNCBMPNSG",
148148
"5555555555555555555555555555555555555555",
149149
true,

0 commit comments

Comments
 (0)