mirror of
https://github.com/fluencelabs/marine.git
synced 2025-03-15 14:00:50 +00:00
reborn circleci (#22)
This commit is contained in:
parent
c48454563c
commit
c90663448f
@ -10,21 +10,14 @@ jobs:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- fce01-{{ checksum "engine/Cargo.toml" }}-{{ checksum "fluence-faas/Cargo.toml" }}
|
||||
- fce01-{{ checksum "engine/Cargo.toml" }}-{{ checksum "fluence-faas/Cargo.toml" }}-{{ checksum "fluence-app-service/Cargo.toml" }}
|
||||
- run: |
|
||||
rustup toolchain install nightly
|
||||
rustup component add rustfmt
|
||||
rustup component add clippy --toolchain nightly
|
||||
|
||||
cd engine
|
||||
cargo fmt --all -- --check --color always
|
||||
cargo +nightly build -v --all-features
|
||||
cargo +nightly test -v --all-features
|
||||
cargo +nightly clippy -v
|
||||
|
||||
cd ../fluence-faas
|
||||
cargo fmt --all -- --check --color always
|
||||
cargo +nightly build -v --all-features
|
||||
cargo +nightly check -v --all-features
|
||||
cargo +nightly test -v --all-features
|
||||
cargo +nightly clippy -v
|
||||
|
||||
@ -32,7 +25,7 @@ jobs:
|
||||
paths:
|
||||
- ~/.cargo
|
||||
- ~/.rustup
|
||||
key: fce01-{{ checksum "engine/Cargo.toml" }}-{{ checksum "fluence-faas/Cargo.toml" }}
|
||||
key: fce01-{{ checksum "engine/Cargo.toml" }}-{{ checksum "fluence-faas/Cargo.toml" }}-{{ checksum "fluence-app-service/Cargo.toml" }}
|
||||
|
||||
examples:
|
||||
docker:
|
||||
|
@ -34,25 +34,50 @@ async fn redis() {
|
||||
.unwrap_or_else(|e| panic!("can't create FCE: {:?}", e));
|
||||
|
||||
let result1 = fce
|
||||
.call(module_name, "invoke", &[IValue::String(String::from("SET A 10"))])
|
||||
.call(
|
||||
module_name,
|
||||
"invoke",
|
||||
&[IValue::String(String::from("SET A 10"))],
|
||||
)
|
||||
.unwrap_or_else(|e| panic!("error while FCE invocation: {:?}", e));
|
||||
let result2 = fce
|
||||
.call(module_name, "invoke", &[IValue::String(String::from("SADD B 20"))])
|
||||
.call(
|
||||
module_name,
|
||||
"invoke",
|
||||
&[IValue::String(String::from("SADD B 20"))],
|
||||
)
|
||||
.unwrap_or_else(|e| panic!("error while FCE invocation: {:?}", e));
|
||||
let result3 = fce
|
||||
.call(module_name, "invoke", &[IValue::String(String::from("GET A"))])
|
||||
.call(
|
||||
module_name,
|
||||
"invoke",
|
||||
&[IValue::String(String::from("GET A"))],
|
||||
)
|
||||
.unwrap_or_else(|e| panic!("error while FCE invocation: {:?}", e));
|
||||
let result4 = fce
|
||||
.call(module_name, "invoke", &[IValue::String(String::from("SMEMBERS B"))])
|
||||
.call(
|
||||
module_name,
|
||||
"invoke",
|
||||
&[IValue::String(String::from("SMEMBERS B"))],
|
||||
)
|
||||
.unwrap_or_else(|e| panic!("error while FCE invocation: {:?}", e));
|
||||
let result5 = fce
|
||||
.call(module_name, "invoke", &[IValue::String(String::from("eval \"redis.call('incr', 'A') return redis.call('get', 'A') * 8 + 5\" 0"))])
|
||||
.call(
|
||||
module_name,
|
||||
"invoke",
|
||||
&[IValue::String(String::from(
|
||||
"eval \"redis.call('incr', 'A') return redis.call('get', 'A') * 8 + 5\" 0",
|
||||
))],
|
||||
)
|
||||
.expect("error while FCE invocation");
|
||||
|
||||
assert_eq!(result1, vec![IValue::String(String::from("+OK\r\n"))]);
|
||||
assert_eq!(result2, vec![IValue::String(String::from(":1\r\n"))]);
|
||||
assert_eq!(result3, vec![IValue::String(String::from("$2\r\n10\r\n"))]);
|
||||
assert_eq!(result4, vec![IValue::String(String::from("*1\r\n$2\r\n20\r\n"))]);
|
||||
assert_eq!(
|
||||
result4,
|
||||
vec![IValue::String(String::from("*1\r\n$2\r\n20\r\n"))]
|
||||
);
|
||||
assert_eq!(result5, vec![IValue::String(String::from(":93\r\n"))]);
|
||||
}
|
||||
|
||||
@ -72,21 +97,27 @@ async fn sqlite() {
|
||||
.call(
|
||||
module_name,
|
||||
"invoke",
|
||||
&[IValue::String(String::from("CREATE VIRTUAL TABLE users USING FTS5(body)"))],
|
||||
&[IValue::String(String::from(
|
||||
"CREATE VIRTUAL TABLE users USING FTS5(body)",
|
||||
))],
|
||||
)
|
||||
.unwrap_or_else(|e| panic!("error while FCE invocation: {:?}", e));
|
||||
let result2 = fce
|
||||
.call(
|
||||
module_name,
|
||||
"invoke",
|
||||
&[IValue::String(String::from("INSERT INTO users(body) VALUES('AB'), ('BC'), ('CD'), ('DE')"))],
|
||||
&[IValue::String(String::from(
|
||||
"INSERT INTO users(body) VALUES('AB'), ('BC'), ('CD'), ('DE')",
|
||||
))],
|
||||
)
|
||||
.unwrap_or_else(|e| panic!("error while FCE invocation: {:?}", e));
|
||||
let result3 = fce
|
||||
.call(
|
||||
module_name,
|
||||
"invoke",
|
||||
&[IValue::String(String::from("SELECT * FROM users WHERE users MATCH 'A* OR B*"))],
|
||||
&[IValue::String(String::from(
|
||||
"SELECT * FROM users WHERE users MATCH 'A* OR B*",
|
||||
))],
|
||||
)
|
||||
.unwrap_or_else(|e| panic!("error while FCE invocation: {:?}", e));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user