Skip to content

Commit 4cf1674

Browse files
committed
update-channels smoke tests with django channels
1 parent 2090fe4 commit 4cf1674

File tree

3 files changed

+7
-30
lines changed

3 files changed

+7
-30
lines changed

.github/workflows/ci.yml

+1-19
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,6 @@ jobs:
8282
- run: yarn test_core
8383

8484
cli_tests:
85-
name: DB.io - CLI Tests
86-
needs: [build]
87-
runs-on: ubuntu-24.04
88-
steps:
89-
- run: sudo apt-get install -y libsqlite3-dev
90-
- uses: actions/checkout@v4
91-
- uses: actions/setup-python@v5
92-
with:
93-
python-version: '3.13'
94-
- name: Install uv
95-
uses: astral-sh/setup-uv@v4
96-
with:
97-
# Install a specific version of uv.
98-
version: "0.5.6"
99-
- run: yarn
100-
- run: make smoke_test
101-
102-
cli_tests_postgres:
10385
name: DB.io - CLI Tests for Postgres
10486
needs: [build]
10587
runs-on: ubuntu-24.04
@@ -133,7 +115,7 @@ jobs:
133115
version: "0.5.6"
134116
- run: yarn
135117
- name: Run Smoke tests with Postgres
136-
run: make smoke_test_postgres_ci
118+
run: make smoke_test_ci
137119
env:
138120
POSTGRES_URL: postgres://postgres:mysecretpassword@localhost:5432/postgres
139121

Makefile

+3-8
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,13 @@ else
2424
endif
2525

2626
smoke_test:
27-
./script/cli_test.sh ${EXAMPLE_PROJECT_JSON}
28-
29-
smoke_test_postgres:
30-
./script/cli_test.sh ${EXAMPLE_PROJECT_POSTGRES_JSON} start_docker
27+
jq -s '.[0] * .[1]' ${EXAMPLE_PROJECT_POSTGRES_JSON} ${PARTIAL_WITH_CHANNELS_JSON} > /tmp/project-with-channels.json
28+
./script/cli_test.sh /tmp/project-with-channels.json start_docker
3129

32-
smoke_test_postgres_channels:
30+
smoke_test_ci:
3331
jq -s '.[0] * .[1]' ${EXAMPLE_PROJECT_POSTGRES_JSON} ${PARTIAL_WITH_CHANNELS_JSON} > /tmp/project-with-channels.json
3432
./script/cli_test.sh /tmp/project-with-channels.json
3533

36-
smoke_test_postgres_ci:
37-
./script/cli_test.sh ${EXAMPLE_PROJECT_POSTGRES_JSON}
38-
3934
create:
4035
yarn run cli ${EXAMPLE_PROJECT_POSTGRES_JSON} ${EXAMPLE_TAR_OUTPUT}
4136
echo "Project created at ${PROJECT_NAME}"

script/cli_test.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ curl --connect-timeout 5 \
7575
"http://127.0.0.1:${DJANGO_PORT}" || kill ${ID}
7676

7777
curl "http://127.0.0.1:${DJANGO_PORT}" | grep "DjangoModel1 Listing"
78-
RESULT=$?
78+
HTTP_RESULT=$?
7979

8080
echo "Test Message" | websocat ws://127.0.0.1:${DJANGO_PORT}/ws/ -1 | grep "Hello from DjangoProjectWithChannels WebSocketConsumer! Test Message"
81-
RESULT_WEBSOCKET=$?
81+
WEBSOCKET_RESULT=$?
8282

8383
echo -e "View Results at \e[32m${DIR}/${PROJECT_NAME}\e[0m"
8484

8585
kill ${ID}
86-
if [ $RESULT -eq 0 ] && [ $RESULT_WEBSOCKET -eq 0 ]; then
86+
if [ $HTTP_RESULT -eq 0 ] && [ $WEBSOCKET_RESULT -eq 0 ]; then
8787
echo -e "\e[32mTest passed\e[0m"
8888
exit 0
8989
else

0 commit comments

Comments
 (0)