Skip to content
/ TestGrid Public

A tool for managing deployment to test environments for large teams of QA testers

License

Notifications You must be signed in to change notification settings

Wavix/TestGrid

Repository files navigation

TestGrid

Features

  • 📚 Stand-repository reservation for the QA engineer
  • 📜 Booking history
  • 📊 Reservation metrics by testers
  • 🔀 Stand switching to Smoke-testing mode
  • 💡 Intuitive web interface
  • 🔧 Support for multiple namespaces in your company (if you have several different development teams)

How does it work?

After integrating into the pipeline process, you gain the ability to control the deployment to test stands for your QA engineers. If a test stand is occupied by another QA engineer, the deployment to the occupied stand will be blocked. You can also switch the stand into smoke-test mode, and deployment for testers will not be possible.

Local setup

Requirements

  • Node.js 20+
  • pnpm 10+

1. Install dependencies

pnpm install

2. Initialize database

Create local SQLite database and tables:

pnpm cli dbcreate

This command recreates the database from models (sync({ force: true })), so it removes existing local data.

3. Run application

pnpm dev

Open http://localhost:3000.

4. Create first user via API

Send a booking request (this creates namespace/user/repository/stand automatically if they do not exist):

curl -XPOST -H "Content-type: application/json" \
  -d '{ "repository": "backend", "user_name": "John Smit", "user_email": "john@company.org", "namespace": "myorg", "stand": "qa1", "branch": "infra/test" }' \
  "http://localhost:3000/api/book"

Expected response:

"Success!"

After that, sign in with john@company.org on http://localhost:3000 and set password.

5. Production build check

pnpm build

Troubleshooting

  • SQLITE_ERROR: no such table: namespaces
    • Database is not initialized. Run pnpm cli dbcreate and restart pnpm dev.
  • Could not locate the bindings file ... sqlite3
    • Rebuild sqlite3 native module:
      • pnpm rebuild sqlite3
  • Port 3000 already in use
    • Stop previous dev process or use the URL shown in terminal (for example http://localhost:3001).

Pipeline Integration

Example: GitLab Integration

To integrate with GitLab, utilize the provided GitLab template:

.testgrid:
  before_script:
    - 'RESPONSE=$(curl -XPOST -H "Content-type: application/json" -d "{ \"repository\": \"$CI_PROJECT_NAME\", \"user_name\": \"$GITLAB_USER_NAME\", \"user_email\": \"$GITLAB_USER_EMAIL\", \"namespace\": \"$CI_PROJECT_NAMESPACE\", \"stand\": \"$DEPLOY_CLUSTER\", \"user_login\": \"$GITLAB_USER_LOGIN\", \"branch\": \"$CI_COMMIT_REF_NAME\" }" "https://testgrid.company.org/api/book" -s)'
    - 'if echo "$RESPONSE" | grep -q "|"; then ERROR_MSG=$(echo "$RESPONSE" | cut -d "|" -f 2); echo -e "\033[0;31mTestGrid Error: $ERROR_MSG\033[0m"; exit 1; fi'

An approximate task in GitLabCI using TestGrid looks as follows:

review:
  stage: deploy
  parallel:
    matrix:
      - DEPLOY_CLUSTER:
          - qa1
          - qa2
  extends: .testgrid
  script:
    - mkdir -p ~/.ssh
    - eval $(ssh-agent -s)
    - echo -e "Host *\nAddKeysToAgent yes\nIgnoreUnknown UseKeychain\nUseKeychain yes\nForwardAgent yes\n\nHost *.company.dev\nPort 22\n\n" > ~/.ssh/config
    ...
  when: manual
  only:
    - branches
  except:
    - master
    - develop

About

A tool for managing deployment to test environments for large teams of QA testers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published