Skip to content

Commit

Permalink
Stubbed remaining tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-kast committed Aug 12, 2022
1 parent af350f1 commit 25d8e25
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 5 deletions.
8 changes: 8 additions & 0 deletions crates/core/src/db/queries/activities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ pub fn list(
.load(conn)
.context("Failed to load activities")
}

#[cfg(test)]
mod tests {
#[test]
fn test_list() {
todo!("Test list()");
}
}
8 changes: 8 additions & 0 deletions crates/core/src/db/queries/bonding_changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,11 @@ pub fn list(
.load(conn)
.context("Failed to load enriched bonding changes")
}

#[cfg(test)]
mod tests {
#[test]
fn test_list() {
todo!("Test list()");
}
}
16 changes: 16 additions & 0 deletions crates/core/src/db/queries/charts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,19 @@ pub fn total_volume_prices(
.load(conn)
.context("Failed to load average prices")
}

#[cfg(test)]
mod tests {
#[test]
fn test_floor_prices() {
todo!("Test floor_prices()");
}
#[test]
fn test_average_prices() {
todo!("Test average_prices()");
}
#[test]
fn test_total_volume_prices() {
todo!("Test total_volume_prices()");
}
}
8 changes: 8 additions & 0 deletions crates/core/src/db/queries/featured_listings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,11 @@ pub fn list(
.load(conn)
.context("Failed to load featured listings")
}

#[cfg(test)]
mod tests {
#[test]
fn test_list() {
todo!("Test list()");
}
}
12 changes: 12 additions & 0 deletions crates/core/src/db/queries/feed_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,15 @@ pub fn list_relay(
.load(conn)
.context("Failed to load feed events")
}

#[cfg(test)]
mod tests {
#[test]
fn test_list() {
todo!("Test list()");
}
#[test]
fn test_list_relay() {
todo!("Test list_relay()");
}
}
13 changes: 13 additions & 0 deletions crates/core/src/db/queries/graph_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ pub fn list(
.load(conn)
.context("failed to load twitter enriched graph connections by addresses")
}

#[cfg(test)]
mod tests {
#[test]
fn test_connections() {
todo!("Test connections()");
}

#[test]
fn test_list() {
todo!("Test list()");
}
}
12 changes: 12 additions & 0 deletions crates/core/src/db/queries/metadatas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,15 @@ pub fn activities(
.load(conn)
.context("Failed to load nft(s) activities")
}

#[cfg(test)]
mod tests {
#[test]
fn test_list() {
todo!("Test list()");
}
#[test]
fn test_activities() {
todo!("Test activities()");
}
}
1 change: 1 addition & 0 deletions crates/core/src/db/queries/nft_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,5 +313,6 @@ mod tests {
let conn = connect();

std::mem::drop(super::store_creators(&conn, Vec::<String>::new()).unwrap());
todo!("Check that the result is non-empty");
}
}
16 changes: 16 additions & 0 deletions crates/core/src/db/queries/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,19 @@ pub fn collection(
.load(conn)
.context("Failed to load collection mint stats")
}

#[cfg(test)]
mod tests {
#[test]
fn test_mint() {
todo!("Test mint()");
}
#[test]
fn test_market() {
todo!("Test market()");
}
#[test]
fn test_collection() {
todo!("Test collection()");
}
}
8 changes: 8 additions & 0 deletions crates/core/src/db/queries/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,11 @@ pub fn activities(conn: &Connection, address: impl ToSql<Text, Pg>) -> Result<Ve
.load(conn)
.context("Failed to load wallet(s) activities")
}

#[cfg(test)]
mod tests {
#[test]
fn test_activities() {
todo!("Test activities()");
}
}
8 changes: 8 additions & 0 deletions crates/graphql/src/schema/dataloaders/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ use tables::collection_stats;

use super::prelude::*;

#[cfg(test)]
mod tests {
#[test]
fn refactor_me() {
todo!("Move the sql_query call into indexer_core and add tests");
}
}

#[async_trait]
impl TryBatchFn<PublicKey<StoreCreator>, Vec<Nft>> for Batcher {
async fn load(
Expand Down
13 changes: 8 additions & 5 deletions scripts/pre-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ set -e
cd "$(dirname "$0")/.."

lib_flags=(--workspace --lib --all-features)
build_flags=("${lib_flags[@]}")
build_flags+=(--bins)
bin_flags=(--workspace --bins --all-features)

[[ -z "$CARGO" ]] && CARGO=cargo

diff --unified <(./diesel.sh print-schema) crates/core/src/db/schema.rs
"$CARGO" fmt --all --check
"$CARGO" clippy "${build_flags[@]}" --no-deps
"$CARGO" clippy "${lib_flags[@]}" --no-deps
"$CARGO" doc "${lib_flags[@]}" --no-deps
"$CARGO" build "${build_flags[@]}"
"$CARGO" test "${build_flags[@]}"
"$CARGO" build "${lib_flags[@]}"
"$CARGO" test "${lib_flags[@]}"

"$CARGO" clippy "${bin_flags[@]}" --no-deps
"$CARGO" build "${bin_flags[@]}"
"$CARGO" test "${bin_flags[@]}"

0 comments on commit 25d8e25

Please sign in to comment.