Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added server health check to github workflow #1717

Merged
merged 12 commits into from
Feb 18, 2024
46 changes: 45 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- name: Run Typescript Type-Checker
run: npm run typecheck


Test-Application:
name: Testing Application
runs-on: ubuntu-latest
Expand Down Expand Up @@ -83,6 +84,27 @@ jobs:
MONGO_DB_URL: mongodb://localhost:27017/talawa-test-db
REDIS_HOST: localhost
REDIS_PORT: 6379
RECAPTCHA_SITE_KEY: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
RECAPTCHA_SECRET_KEY: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Copy link
Contributor

@palisadoes palisadoes Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the app start when using these "XXXXXXXXXXXXXXXXXXXXXXXXXX" RECAPTCHA values?

MAIL_USERNAME: "abc@gmail.com"
MAIL_PASSWORD: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Copy link
Contributor

@palisadoes palisadoes Feb 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the app start when using this "XXXXXXXXXXXXXXXXXXXXXXXXXX" value?
If the app doesn't start using these values, then this isn't a valid test.

IS_SMTP: ""
SMTP_HOST: ""
SMTP_PASSWORD: ""
SMTP_USERNAME: ""
messagingSenderId: "XXXXXXXXXXXX"
projectId: "appname-XXXXXX"
storageBucket: "appname-XXXXXX.appspot.com"
iOSapiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
iOSappId: "1:XXXXXXXXXXXX:ios:XXXXXXXXXXXXXXXXXXXXXX"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are no longer used in the .env file
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no tokens defined:

  • ACCESS_TOKEN_SECRET
  • REFRESH_TOKEN_SECRET

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried starting the server with these .env values on your local system?

iOSmessagingSenderId: "XXXXXXXXXXXX"
iOSprojectId: "appame-XXXXXX"
iOSstorageBucket: "appame-XXXXXX.appspot.com"
iosClientId: "XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com"
iosBundleId: "com.appname.app"
LAST_RESORT_SUPERADMIN_EMAIL: "abc@gmail.com"
COLORIZE_LOGS: "true"
LOG_LEVEL: "info"
# ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
# REFRESH_TOKEN_SECRET: ${{ secrets.REFRESH_TOKEN_SECRET }}

Expand All @@ -109,6 +131,29 @@ jobs:

- name: Run the tests
run: npm run test

- name: Start the development server
run: |
npm run dev &
echo "Development server started..."

- name: Check server status
shankeleven marked this conversation as resolved.
Show resolved Hide resolved
run: |
if curl -f 'http://localhost:4000' | jq -e '. == {"talawa-version":"v1","status":"healthy"}' > /dev/null; then
echo "Server is up and healthy"
else
echo "Server is down"
exit 1
fi
- name: Check Apollo Server status
run: |
if curl -f 'http://localhost:4000/graphql?query=%7B__typename%7D' \
SiddheshKukade marked this conversation as resolved.
Show resolved Hide resolved
-H 'Apollo-Require-Preflight: true' | jq -e '. == {"data":{"__typename":"Query"}}' > /dev/null; then
echo "Apollo Server is up"
else
echo "Server is down"
exit 1
fi

- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v3
Expand All @@ -122,7 +167,6 @@ jobs:
with:
path: './coverage/lcov.info'
min_coverage: 95.0

JSDocs:
name: 'JSDocs comments and pipeline'
runs-on: ubuntu-latest
Expand Down
25 changes: 5 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"uuid": "^9.0.0",
"validator": "^13.7.0",
"vite": "^3.2.7",
SiddheshKukade marked this conversation as resolved.
Show resolved Hide resolved
"vm2": "^3.9.19",
"winston": "^3.8.0",
"ws": "^8.15.0",
"xss-clean": "^0.1.1",
Expand Down