Skip to content

Commit 678c7c7

Browse files
committed
update ci tests
1 parent 444f4ff commit 678c7c7

File tree

1 file changed

+7
-37
lines changed

1 file changed

+7
-37
lines changed

.github/workflows/ci-tests.yml

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs:
2828
- name: Run pre-commit hooks
2929
uses: pre-commit/action@v3.0.1
3030

31+
3132
unit-tests:
3233
runs-on: ubuntu-24.04
34+
3335
if: github.event.pull_request.draft == false
3436
needs: pre-commit
3537
env:
@@ -48,58 +50,26 @@ jobs:
4850
- name: Install dependencies
4951
run: |
5052
python -m pip install --upgrade pip
51-
if [ -f requirements.txt ]; then
53+
if [ -f requirements.txt ];
54+
then
5255
pip install -r requirements.txt
5356
fi
5457
5558
- name: Install Azure Functions Core Tools
5659
run: |
5760
npm install -g azure-functions-core-tools@4 --unsafe-perm true
5861
59-
- name: Test function imports
60-
run: |
61-
echo "Testing function_app.py import..."
62-
python -c "
63-
try:
64-
import function_app
65-
print('SUCCESS: function_app imported')
66-
except Exception as e:
67-
print('FAILED:', str(e))
68-
exit(1)
69-
"
70-
7162
- name: Start Azure Functions
7263
run: |
7364
# Start Azure Functions in the background
74-
func start --port 7071 --no-build --verbose > func.log 2>&1 &
65+
func start --port 7071 --no-build > func.log 2>&1 &
7566
echo $! > func.pid
76-
77-
# Wait for the functions to be ready with better checking
78-
echo "Waiting for Azure Functions to start..."
79-
for i in {1..30}; do
80-
if curl -s -f http://localhost:7071/api/resources/filters > /dev/null 2>&1; then
81-
echo "Azure Functions is ready! (attempt $i)"
82-
break
83-
fi
84-
if [ $i -eq 30 ]; then
85-
echo "Functions failed to start after 30 attempts. Logs:"
86-
cat func.log
87-
exit 1
88-
fi
89-
echo "Attempt $i/30: Functions not ready yet..."
90-
sleep 2
91-
done
67+
# Wait for the functions to be ready (adjust time as needed)
68+
sleep 20
9269
9370
- name: Run tests
9471
run: |
9572
python3 -m unittest tests.resources_api_unit_tests -v
96-
97-
- name: Show logs on failure
98-
if: failure()
99-
run: |
100-
echo "=== Azure Functions Logs ==="
101-
cat func.log || echo "No func.log found"
102-
10373
- name: Cleanup Azure Functions
10474
if: always()
10575
run: |

0 commit comments

Comments
 (0)