Skip to content

Commit

Permalink
add redis instance to CI + change test config to use ForegroundBlocki…
Browse files Browse the repository at this point in the history
…ng worker mode
  • Loading branch information
kaplanelad committed Dec 15, 2024
1 parent cfd344b commit e917bfa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/loco-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ jobs:
permissions:
contents: read

services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- "6379:6379"

steps:
- name: Checkout the code
uses: actions/checkout@v4
Expand Down Expand Up @@ -75,3 +86,4 @@ jobs:
LOCO_DEV_MODE_PATH: ${{ github.workspace }}
# NOTE NOTE NOTE: this is for optimizing build and may result in strange behavior
CARGO_TARGET_DIR: /tmp/shared-target
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
2 changes: 1 addition & 1 deletion loco-new/base_template/config/test.yaml.t
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ workers:
# - BackgroundQueue - Workers operate asynchronously in the background, processing queued.
# - ForegroundBlocking - Workers operate in the foreground and block until tasks are completed.
# - BackgroundAsync - Workers operate asynchronously in the background, processing tasks with async capabilities.
mode: {{settings.background.kind}}
mode: ForegroundBlocking

{% if settings.background.kind == "BackgroundQueue"%}
# Queue Configuration
Expand Down
8 changes: 0 additions & 8 deletions loco-new/tests/wizard/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,6 @@ fn test_combination(
.run()
.is_ok());

assert!(cmd!("cat", "config/test.yaml",)
.full_env(&env_map)
// .stdout_null()
// .stderr_null()
.dir(test_dir.path.as_path())
.run()
.is_ok());

cmd!("cargo", "test")
// .stdout_null()
// .stderr_null()
Expand Down

0 comments on commit e917bfa

Please sign in to comment.