Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce the build time #552

Merged
merged 27 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3c03fd0
feat: add doc store
imotai Jun 13, 2023
bf6b69b
Merge remote-tracking branch 'origin/main'
imotai Jun 14, 2023
50dd93a
Merge remote-tracking branch 'origin/main'
imotai Jun 19, 2023
99d8aad
Merge remote-tracking branch 'origin/main'
imotai Jun 21, 2023
ea84758
Merge remote-tracking branch 'origin/main'
imotai Jun 23, 2023
3dc6d3a
Merge remote-tracking branch 'origin/main'
imotai Jun 25, 2023
954d205
Merge remote-tracking branch 'origin/main'
imotai Jun 26, 2023
a70c835
Merge remote-tracking branch 'origin/main'
imotai Jun 29, 2023
4da2934
Merge remote-tracking branch 'origin/main'
imotai Jun 29, 2023
e2938c9
Merge remote-tracking branch 'origin/main'
imotai Jul 2, 2023
afaaa0c
Merge remote-tracking branch 'origin/main'
imotai Jul 3, 2023
3851509
Merge remote-tracking branch 'origin/main'
imotai Jul 4, 2023
20e1d28
Merge remote-tracking branch 'origin/main'
imotai Jul 4, 2023
0cc9a4f
feat: add doc order and event recover
imotai Jul 4, 2023
533b73c
feat: add recover
imotai Jul 4, 2023
f5e37a3
feat: add start block
imotai Jul 4, 2023
411f565
fix: fix the recover bug
imotai Jul 5, 2023
a85e395
fix: merge from main
imotai Jul 5, 2023
51decb5
fix: remove unused module
imotai Jul 5, 2023
89ea4bd
fix: remove docker cd
imotai Jul 5, 2023
a963378
fix: print the test environment output log
imotai Jul 5, 2023
604b0bf
fix: start localnet for every step
imotai Jul 5, 2023
da81bc9
fix: add cd for cargo test
imotai Jul 5, 2023
d2744c1
feat: remove kill process
imotai Jul 5, 2023
149070c
feat: update start local net
imotai Jul 5, 2023
26856d0
fix: fix the test case
imotai Jul 5, 2023
8567eff
fix: fix the java ut case
imotai Jul 5, 2023
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
30 changes: 0 additions & 30 deletions .github/labeler.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true

- uses: Swatinem/rust-cache@v2
- name: Setup build env
run: |
Expand All @@ -41,7 +40,6 @@ jobs:
if [[ ${{ matrix.job.target }} == x86_64-apple-darwin ]]; then
brew install protobuf
fi

- name: Cargo build
uses: actions-rs/cargo@v1
with:
Expand Down Expand Up @@ -70,8 +68,5 @@ jobs:
files: |
target/${{ matrix.job.target }}/release/db3*.tar.gz
target/${{ matrix.job.target }}/release/db3*.sha256
tools/db3up
config/devnet/genesis.json
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}

18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ jobs:
cd ${ROOT_DIR}/metadata && npx hardhat test && echo "return code $?"
test -e ${ROOT_DIR}/metadata/artifacts/contracts/DB3MetaStore.sol/DB3MetaStore.json && cp -f ${ROOT_DIR}/metadata/artifacts/contracts/DB3MetaStore.sol/DB3MetaStore.json ${ROOT_DIR}/abi/
cd ${ROOT_DIR} && cargo build
cd ${ROOT_DIR}/tools && bash start_localnet.sh >db3.log 2>&1 &
sleep 3
cd ${ROOT_DIR}/tools && tail -n200 db3.log
- name: Run rust test with coverage
run: |
cargo llvm-cov nextest --workspace --exclude merkdb --lcov --output-path lcov.info --no-fail-fast
- name: Run sdk test
cd ${ROOT_DIR}/tools && bash start_localnet.sh
sleep 2
- name: Run Typescript sdk test
run: |
ROOT_DIR=`pwd`
cd $ROOT_DIR/sdk && yarn && make
cd $ROOT_DIR/sdk && yarn test --coverage
- name: Rust java sdk test
- name: Rust Java sdk test
run: |
cd java && mvn test
ROOT_DIR=`pwd`
cd ${ROOT_DIR}/java && mvn test
- name: Run rust test with coverage
run: |
cargo llvm-cov nextest --workspace --exclude merkdb --lcov --output-path lcov.info --no-fail-fast
- uses: codecov/codecov-action@v3
with:
token: ${{secrets.COV_TOKEN}}
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/docker_cd.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/labeler.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/pr_labeler.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "thirdparty/merkdb"]
path = thirdparty/merkdb
url = https://github.com/dbpunk-labs/merkdb.git
[submodule "thirdparty/arweave-rs"]
path = thirdparty/arweave-rs
url = https://github.com/imotai/arweave-rs.git
Expand Down
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ members = [
"src/error",
"src/types",
"src/base",
"src/session",
"src/storage",
"src/node",
"src/sdk",
"src/event",
"src/cmd"
"src/event"
]

[workspace.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion java/src/test/java/network/db3/provider/ClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testAddCollection() {
AddDocResult addDocResult = client.addDoc(result.getDb(), "col1", doc);
Assert.assertNotNull(addDocResult.getMutationId());
Thread.sleep(1000 * 3);
ResultSet resultSet = client.runQuery(result.getDb(), "col1", "/[name=\"a\"]");
ResultSet resultSet = client.runQuery(result.getDb(), "col1", "/[name=1]");
Assert.assertEquals(1, resultSet.getDocs().size());
} catch (Exception e) {
e.printStackTrace();
Expand Down
5 changes: 2 additions & 3 deletions sdk/tests/client_v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,14 +497,12 @@ describe('test db3.js client module', () => {
[index]
)
const collection2 = await getCollection(db.addr, 'col', client2)

await new Promise((r) => setTimeout(r, 3000))
const docId2 = await addDoc(collection, {
city: 'beijing',
author: 'imotai',
age: 10,
})

const docId3 = await addDoc(collection2, {
city: 'beijing2',
author: 'imotai1',
Expand All @@ -523,6 +521,7 @@ describe('test db3.js client module', () => {
expect(resultSet.docs[0].doc.age).toBe(10)
expect(resultSet.docs[0].id).toBe(docId2.id)
}

{
const queryStr = '/[city = beijing]'
const resultSet = await queryDoc<Profile>(
Expand All @@ -540,7 +539,7 @@ describe('test db3.js client module', () => {
await deleteDoc(collection, [docId3.id])
fail('should not be here')
} catch (e) {
expect(decodeURI(e.message)).toBe(
expect(e.message).toBe(
'fail to verify the owner with error doc owner is not the sender'
)
}
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ db3-base={ path = "../base" }
db3-sdk={ path = "../sdk" }
db3-proto={ path = "../proto" }
db3-crypto={ path = "../crypto" }
db3-session={ path = "../session" }
ethereum-types = { version = "0.14.0", default-features = false }
prost = "0.11"
prost-types = "0.11"
Expand All @@ -42,6 +41,5 @@ tonic = {workspace=true}
http = "0.2"
eyre = "0.6"
[dev-dependencies]
db3-session={ path = "../session"}
db3-crypto={ path = "../crypto"}
tokio = { version = "1.17.0", features = ["full"] }
6 changes: 0 additions & 6 deletions src/cmd/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,10 @@ use db3_proto::db3_mutation_proto::{
CollectionMutation, DatabaseAction, DatabaseMutation, DocumentMask, DocumentMutation,
};
use db3_proto::db3_node_proto::NetworkStatus;
use db3_sdk::mutation_sdk::MutationSDK;
use db3_sdk::store_sdk::StoreSDK;
use db3_sdk::store_sdk_v2::StoreSDKV2;
use prettytable::{format, Table};
use std::time::{SystemTime, UNIX_EPOCH};

pub struct DB3ClientContext {
pub mutation_sdk: Option<MutationSDK>,
pub store_sdk: Option<StoreSDK>,
}
pub struct DB3ClientContextV2 {
pub store_sdk: Option<StoreSDKV2>,
}
Expand Down
14 changes: 7 additions & 7 deletions src/cmd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// limitations under the License.
//

#![feature(iter_intersperse)]
#[macro_use]
extern crate prettytable;
pub mod command;
pub mod console;
pub mod keystore;
pub mod shell;
//#![feature(iter_intersperse)]
//#[macro_use]
//extern crate prettytable;
//pub mod command;
//pub mod console;
//pub mod keystore;
//pub mod shell;
Loading
Loading