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

feature/update-ci-testing #285

Merged
merged 15 commits into from
May 4, 2022
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
71 changes: 33 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,41 +140,41 @@ commands:

save-cargo-cache:
steps:
- run:
name: Prepare Cargo cache for saving
command: |
set -x
# - run:
# name: Prepare Cargo cache for saving
# command: |
# set -x

command -v cargo-install-update >/dev/null || cargo install cargo-update
command -v cargo-trim >/dev/null || cargo install cargo-trim
# command -v cargo-install-update >/dev/null || cargo install cargo-update
# command -v cargo-trim >/dev/null || cargo install cargo-trim

cargo install-update --all
# cargo install-update --all

# Configure cargo-trim with the project's Cargo.lock files
mkdir -p ~/.config
cargo trim --directory "$(pwd)"
cargo trim --directory "$(pwd)/mobilecoin/consensus/enclave/trusted"
# # Configure cargo-trim with the project's Cargo.lock files
# mkdir -p ~/.config
# cargo trim --directory "$(pwd)"
# cargo trim --directory "$(pwd)/mobilecoin/consensus/enclave/trusted"

# Clean dependencies not in the Cargo.lock
time cargo trim --orphan-clean
# # Clean dependencies not in the Cargo.lock
# time cargo trim --orphan-clean

# Make sure all dependencies are downloaded, since there appears to be
# a bug where cargo trim erroneously removes certain git repos.
time cargo fetch --locked
(cd mobilecoin/consensus/enclave/trusted && time cargo fetch --locked)
# # Make sure all dependencies are downloaded, since there appears to be
# # a bug where cargo trim erroneously removes certain git repos.
# time cargo fetch --locked
# (cd mobilecoin/consensus/enclave/trusted && time cargo fetch --locked)

# Remove the registry src dir since it's the largest dir and it's
# recreatable from the archives in ~/.cargo/cache
time cargo trim --wipe src
# # Remove the registry src dir since it's the largest dir and it's
# # recreatable from the archives in ~/.cargo/cache
# time cargo trim --wipe src

# Run git compress on cached repos
time cargo trim --gc all
# # Run git compress on cached repos
# time cargo trim --gc all

# Display Cargo cache stats
cargo trim --query
# # Display Cargo cache stats
# cargo trim --query

# Uninstall binary cargo crates that don't need to be cached
time cargo uninstall cargo-trim cargo-update
# # Uninstall binary cargo crates that don't need to be cached
# time cargo uninstall cargo-trim cargo-update
- save_cache:
name: Save Cargo cache
# See https://discuss.circleci.com/t/add-mechanism-to-update-existing-cache-key/9014/13
Expand All @@ -183,7 +183,6 @@ commands:
paths:
- ~/.cargo/.crates.toml
- ~/.cargo/bin
- ~/.cargo/git/checkout
- ~/.cargo/git/db
- ~/.cargo/registry/cache
- ~/.cargo/registry/index
Expand Down Expand Up @@ -374,9 +373,6 @@ jobs:
- prepare-for-build
- run-tests
- check-dirty-git
- when:
condition: { equal: [ << pipeline.git.branch >>, develop ] }
steps: [ save-sccache-cache ]
- post-build
- post-test

Expand All @@ -395,9 +391,8 @@ jobs:
- lint
- generate-docs
- check-dirty-git
- when:
condition: { equal: [ << pipeline.git.branch >>, develop ] }
steps: [ save-cargo-cache, save-sccache-cache ]
- save-cargo-cache
- save-sccache-cache
- post-build

# Build using macOS
Expand Down Expand Up @@ -455,11 +450,11 @@ workflows:
- build-and-lint-debug

# Build using macOS
- build-macos:
name: build-macos-xcode-<< matrix.xcode-version >>
matrix:
parameters:
xcode-version: ["11.7.0", *default-xcode-version]
# - build-macos:
# name: build-macos-xcode-<< matrix.xcode-version >>
# matrix:
# parameters:
# xcode-version: ["11.7.0", *default-xcode-version]

# build everything in release - currently disabled since it's a waste of CPU/$
# - build-release
14 changes: 2 additions & 12 deletions full-service/src/json_rpc/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4419,12 +4419,7 @@ mod e2e {
let view_only_account_id = account_obj.get("account_id").unwrap().as_str().unwrap();

// sync view-only account and check balance
manually_sync_view_only_account(
&ledger_db,
&wallet_db,
&view_only_account_id,
&logger,
);
manually_sync_view_only_account(&ledger_db, &wallet_db, &view_only_account_id, &logger);

let body = json!({
"jsonrpc": "2.0",
Expand Down Expand Up @@ -4480,12 +4475,7 @@ mod e2e {
let payments_tx_proposal =
mc_mobilecoind::payments::TxProposal::try_from(&json_tx_proposal).unwrap();
add_block_with_tx_proposal(&mut ledger_db, payments_tx_proposal);
manually_sync_view_only_account(
&ledger_db,
&wallet_db,
&view_only_account_id,
&logger,
);
manually_sync_view_only_account(&ledger_db, &wallet_db, &view_only_account_id, &logger);
assert_eq!(
ledger_db.num_blocks().unwrap(),
(BASE_TEST_BLOCK_HEIGHT + 2) as u64
Expand Down