-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore: Added capability of running ITs using ok-to-test #38355
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
Changes from all commits
9b65433
292b79d
3807767
0a38fcf
63db037
cb3fd9c
30e69a8
ac6178e
31a00dc
982bbd8
f5eef46
1a4cec0
960682d
4aa2f3a
01526e9
9df624e
ab5e803
0ac5005
28ec34d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,108 @@ | ||||||||||||||||||||||||||||||||||||||||
| name: Server Integrations Tests Workflow | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||
| # This line enables manual triggering of this workflow. | ||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||
| workflow_call: | ||||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||||
| pr: | ||||||||||||||||||||||||||||||||||||||||
| description: "This is the PR number in case the workflow is being called in a pull request" | ||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||
| type: number | ||||||||||||||||||||||||||||||||||||||||
| is-pg-build: | ||||||||||||||||||||||||||||||||||||||||
| description: "Flag for PG build" | ||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||||||
| default: "false" | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||
| run-tests: | ||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest-8-cores | ||||||||||||||||||||||||||||||||||||||||
sagar-qa007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||
| if: | | ||||||||||||||||||||||||||||||||||||||||
| github.event.pull_request.head.repo.full_name == github.repository || | ||||||||||||||||||||||||||||||||||||||||
| github.event_name == 'workflow_dispatch' | ||||||||||||||||||||||||||||||||||||||||
| defaults: | ||||||||||||||||||||||||||||||||||||||||
| run: | ||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||
| # Service containers to run with this job. Required for running tests | ||||||||||||||||||||||||||||||||||||||||
| services: | ||||||||||||||||||||||||||||||||||||||||
| # Label used to access the service container | ||||||||||||||||||||||||||||||||||||||||
| redis: | ||||||||||||||||||||||||||||||||||||||||
| # Docker Hub image for Redis | ||||||||||||||||||||||||||||||||||||||||
| image: redis | ||||||||||||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||||||||||||
| # Opens tcp port 6379 on the host and service container | ||||||||||||||||||||||||||||||||||||||||
| - 6379:6379 | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||
| # Check out merge commit | ||||||||||||||||||||||||||||||||||||||||
| - name: Fork based /ok-to-test checkout | ||||||||||||||||||||||||||||||||||||||||
| if: inputs.pr != 0 | ||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| ref: "refs/pull/${{ inputs.pr }}/merge" | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Checkout the code in the current branch in case the workflow is called because of a branch push event | ||||||||||||||||||||||||||||||||||||||||
| - name: Checkout the head commit of the branch | ||||||||||||||||||||||||||||||||||||||||
| if: inputs.pr == 0 | ||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Setup Java | ||||||||||||||||||||||||||||||||||||||||
| - name: Set up JDK 17 | ||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-java@v4 | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| distribution: "temurin" | ||||||||||||||||||||||||||||||||||||||||
| java-version: "17" | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Conditionally start PostgreSQL | ||||||||||||||||||||||||||||||||||||||||
| if: | | ||||||||||||||||||||||||||||||||||||||||
| inputs.is-pg-build == 'true' | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| docker run --name appsmith-pg -p 5432:5432 -d -e POSTGRES_PASSWORD=password postgres:alpine postgres -N 1500 | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Download the server build artifact | ||||||||||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| name: server-build | ||||||||||||||||||||||||||||||||||||||||
| path: app/server/dist/ | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Download the rts build artifact | ||||||||||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| name: rts-dist | ||||||||||||||||||||||||||||||||||||||||
| path: app/client/packages/rts/dist | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Un-tar the rts folder | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| tar -xvf app/client/packages/rts/dist/rts-dist.tar -C app/client/packages/rts/ | ||||||||||||||||||||||||||||||||||||||||
| echo "Cleaning up the rts tar files" | ||||||||||||||||||||||||||||||||||||||||
| rm app/client/packages/rts/dist/rts-dist.tar | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Run rts using the untarred files | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| nohup -- node app/client/packages/rts/dist/bundle/server.js & | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+81
to
+84
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add verification for RTS server startup. The RTS server is started in the background, but there's no verification that it started successfully. nohup -- node app/client/packages/rts/dist/bundle/server.js &
+# Wait for RTS server to be ready
+for i in {1..30}; do
+ if curl -s http://localhost:8091/health >/dev/null; then
+ echo "RTS server is ready"
+ break
+ fi
+ if [ $i -eq 30 ]; then
+ echo "RTS server failed to start"
+ exit 1
+ fi
+ echo "Waiting for RTS server... ($i/30)"
+ sleep 1
+done📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
| - name: Run only integration tests on server | ||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||
| ACTIVE_PROFILE: test | ||||||||||||||||||||||||||||||||||||||||
| APPSMITH_CLOUD_SERVICES_BASE_URL: "https://release-cs.appsmith.com" | ||||||||||||||||||||||||||||||||||||||||
| APPSMITH_CLOUD_SERVICES_TEMPLATE_UPLOAD_AUTH: ${{ secrets.APPSMITH_CLOUD_SERVICES_TEMPLATE_UPLOAD_AUTH }} | ||||||||||||||||||||||||||||||||||||||||
| APPSMITH_REDIS_URL: "redis://127.0.0.1:6379" | ||||||||||||||||||||||||||||||||||||||||
| APPSMITH_ENCRYPTION_PASSWORD: "password" | ||||||||||||||||||||||||||||||||||||||||
| APPSMITH_ENCRYPTION_SALT: "salt" | ||||||||||||||||||||||||||||||||||||||||
| APPSMITH_ENVFILE_PATH: /tmp/dummy.env | ||||||||||||||||||||||||||||||||||||||||
| APPSMITH_VERBOSE_LOGGING_ENABLED: false | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| if [[ "${{ inputs.is-pg-build }}" == "true" ]]; then | ||||||||||||||||||||||||||||||||||||||||
| export APPSMITH_DB_URL="postgresql://postgres:password@localhost:5432/postgres" | ||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||
| export APPSMITH_DB_URL="mongodb://localhost:27017/mobtools" | ||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| args=() | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Run tests and capture logs | ||||||||||||||||||||||||||||||||||||||||
| cd app/server | ||||||||||||||||||||||||||||||||||||||||
| mvn verify -DskipUTs=true "${args[@]}" | tee mvn_integration_test.log | ||||||||||||||||||||||||||||||||||||||||
sagar-qa007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.