File tree Expand file tree Collapse file tree 5 files changed +28
-27
lines changed
atcoder-client/src/atcoder Expand file tree Collapse file tree 5 files changed +28
-27
lines changed Original file line number Diff line number Diff line change 1+ .PHONY : help
2+ help :
3+ @awk -F ' :|##' ' /^[^\t].+?:.*?##/ { printf "\033[36m%-22s\033[0m %s\n", $$1, $$NF }' $(MAKEFILE_LIST )
4+
5+ .PHONY : up
6+ up :
7+ docker compose up
8+
9+ .PHONY : down
10+ down :
11+ docker compose down
12+
13+ .PHONY : test/backend
14+ test/backend :
15+ docker compose exec backend-development cargo test --workspace --no-fail-fast -- --test-threads=1
Original file line number Diff line number Diff line change 1- FROM rust:1.63.0 AS development
2- RUN rustup component add rustfmt
3- RUN rustup component add clippy
4-
51# Using the official cargo-chef image
62FROM lukemathwalker/cargo-chef:latest-rust-1.63.0 AS chef
73WORKDIR /app
Original file line number Diff line number Diff line change 1+ FROM rust:1.63.0 AS development
2+ RUN rustup component add rustfmt
3+ RUN rustup component add clippy
4+
5+ # Install cargo-watch
6+ RUN wget "https://github.com/watchexec/cargo-watch/releases/download/v8.4.0/cargo-watch-v8.4.0-$(uname -m)-unknown-linux-gnu.tar.xz" \
7+ && tar -xf "cargo-watch-v8.4.0-$(uname -m)-unknown-linux-gnu.tar.xz" \
8+ && cp "cargo-watch-v8.4.0-$(uname -m)-unknown-linux-gnu/cargo-watch" /usr/local/bin/ \
9+ && rm -rf "cargo-watch-v8.4.0-$(uname -m)-unknown-linux-gnu"
Original file line number Diff line number Diff line change @@ -115,25 +115,4 @@ mod tests {
115115 let problems = client. fetch_problem_list ( "abc107" ) . await . unwrap ( ) ;
116116 assert_eq ! ( problems. len( ) , 4 ) ;
117117 }
118-
119- #[ tokio:: test]
120- async fn test_fetch_submission_list ( ) {
121- let client = AtCoderClient :: default ( ) ;
122- let response = client
123- . fetch_atcoder_submission_list ( "xmascon17" , None )
124- . await
125- . unwrap ( ) ;
126- assert_eq ! ( response. submissions. len( ) , 20 ) ;
127-
128- let response = client
129- . fetch_atcoder_submission_list ( "xmascon17" , Some ( response. max_page ) )
130- . await
131- . unwrap ( ) ;
132- assert ! ( !response. submissions. is_empty( ) ) ;
133-
134- let response = client
135- . fetch_atcoder_submission_list ( "xmascon17" , Some ( response. max_page + 1 ) )
136- . await ;
137- assert ! ( response. is_err( ) ) ;
138- }
139118}
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ services:
1414 - " 15432:5432"
1515
1616 backend-development :
17- image : rust:1.63.0
17+ build :
18+ context : ./atcoder-problems-backend
19+ dockerfile : Dockerfile.dev
1820 environment :
1921 SQL_URL : postgres://db_user:db_pass@postgresql:5432/test_db
2022 DATABASE_URL : postgres://db_user:db_pass@postgresql:5432/test_db
@@ -28,7 +30,7 @@ services:
2830 - cargo-cache:/usr/local/cargo/registry
2931 - target-cache:/app/atcoder-problems-backend/target
3032 working_dir : /app/atcoder-problems-backend
31- command : /bin/sh -c "while sleep 1000; do :; done "
33+ command : /bin/sh -c "cargo watch -s 'cargo run --bin run_server' "
3234
3335 frontend-development :
3436 image : node:16
You can’t perform that action at this time.
0 commit comments