Skip to content

Commit 09bf60c

Browse files
GeekTrainerCopilot
andcommitted
Fix seed script name and database path fallback
- Correct seed_test_database.py to seed_database.py (actual filename) - Add fallback for vars.TEST_DATABASE_PATH in case repo variable isn't set yet Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 46a7374 commit 09bf60c

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/actions/setup-python-env/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ runs:
3030

3131
- name: Seed the database
3232
id: seed
33-
run: python server/utils/seed_test_database.py
33+
run: python server/utils/seed_database.py
3434
shell: bash
3535
env:
3636
DATABASE_PATH: ${{ inputs.database-path }}

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: ./.github/actions/setup-python-env
2626
with:
2727
python-version: ${{ matrix.python-version }}
28-
database-path: ${{ vars.TEST_DATABASE_PATH }}
28+
database-path: ${{ vars.TEST_DATABASE_PATH || './test_dogshelter.db' }}
2929

3030
- name: Run tests
3131
run: python -m unittest test_app -v
@@ -43,7 +43,7 @@ jobs:
4343
id: seed
4444
uses: ./.github/actions/setup-python-env
4545
with:
46-
database-path: ${{ vars.TEST_DATABASE_PATH }}
46+
database-path: ${{ vars.TEST_DATABASE_PATH || './test_dogshelter.db' }}
4747

4848
- name: Set up Node.js
4949
uses: actions/setup-node@v4

content/github-actions/7-custom-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In this exercise you'll create a composite action that sets up the Python enviro
99

1010
## Scenario
1111

12-
The pet shelter's test workflows need to seed the database before running tests. This involves setting up Python, installing dependencies, and running `seed_test_database.py`. Rather than duplicating these steps in every workflow, we'll create a custom composite action that any workflow can reference in a single step.
12+
The pet shelter's test workflows need to seed the database before running tests. This involves setting up Python, installing dependencies, and running `seed_database.py`. Rather than duplicating these steps in every workflow, we'll create a custom composite action that any workflow can reference in a single step.
1313

1414
## Background
1515

@@ -72,7 +72,7 @@ Let's create a composite action that sets up Python, installs dependencies, and
7272
7373
- name: Seed the database
7474
id: seed
75-
run: python server/utils/seed_test_database.py
75+
run: python server/utils/seed_database.py
7676
shell: bash
7777
env:
7878
DATABASE_PATH: ${{ inputs.database-path }}

0 commit comments

Comments
 (0)