Useful Development Commands
Quick reference for common development commands in omegaUp.
Linting and Validation
Run All Linters
./stuff/lint.sh
git push.
Location: Outside Docker container, project root
Validate Style Only
./stuff/lint.sh validate
Generate i18n Files
./stuff/lint.sh --linters=i18n fix --all
*.lang files based on es.lang, en.lang, and pt.lang.
Testing
Run All PHP Tests
./stuff/runtests.sh
Location: Inside Docker container
Run Specific PHP Test File
./stuff/run-php-tests.sh frontend/tests/controllers/$MY_FILE.php
Run Cypress Tests
npx cypress open
Prerequisites: - Node.js installed - npm installed - libasound2 (Linux)
Location: Outside Docker container
Run Vue Unit Tests (Watch Mode)
yarn run test:watch
Run Specific Vue Test File
./node_modules/.bin/jest frontend/www/js/omegaup/components/$MY_FILE.test.ts
Database
Reset Database to Initial State
./stuff/bootstrap-environment.py --purge
Location: Inside Docker container
Apply Database Migrations
./stuff/db-migrate.py migrate --databases=omegaup,omegaup-test
Location: Inside Docker container
Update schema.sql from Migrations
./stuff/update-dao.sh
schema.sql when adding new migration files.
Location: Inside Docker container
PHP Type Validation
Run Psalm on All PHP Files
find frontend/ \
-name *.php \
-and -not -wholename 'frontend/server/libs/third_party/*' \
-and -not -wholename 'frontend/tests/badges/*' \
-and -not -wholename 'frontend/tests/controllers/*' \
-and -not -wholename 'frontend/tests/runfiles/*' \
-and -not -wholename 'frontend/www/preguntas/*' \
| xargs ./vendor/bin/psalm \
--long-progress \
--show-info=false
Location: Inside Docker container
Docker
Restart Docker Service
systemctl restart docker.service
Location: Outside Docker container (Linux)
Access Container Console
docker exec -it omegaup-frontend-1 /bin/bash
Quick Reference
| Task | Command | Location |
|---|---|---|
| Lint code | ./stuff/lint.sh |
Outside container |
| Run PHP tests | ./stuff/runtests.sh |
Inside container |
| Run Cypress | npx cypress open |
Outside container |
| Reset DB | ./stuff/bootstrap-environment.py --purge |
Inside container |
| Migrate DB | ./stuff/db-migrate.py migrate |
Inside container |
| Vue tests | yarn run test:watch |
Inside container |
Related Documentation
- Testing Guide - Comprehensive testing documentation
- Coding Guidelines - Code standards
- Development Setup - Environment setup