Improvement Challenge Platform - Copilot
- See Tools for Web Development for environment setup steps
- Install Java.
- Add
triton
user to MySQLCREATE USER 'triton'@'localhost' IDENTIFIED BY 'triton';
GRANT ALL PRIVILEGES ON *.* TO 'triton'@'localhost';
- Retrieve source code and install
git clone PERTS/triton
cd triton
git submodule update --init --recursive
npm install
pip install --user mock
- Start things up
- MySQL: start MySQL via the System Preference plugin
- Neptune Server:
npm run server
(from yourneptune
directory) - Triton Server:
npm run server
(from yourtriton
directory) - Triton Webpack Dev Server:
npm start
(from yourtriton
directory)
- Run tests
./run_tests.py
npm test
- Generate fake development data
npm run faker
- Only generates user, team, classroom at the moment
- Doesn't create user accounts on neptune, so can't login with them
Part of the App Engine SDK is based on Java (the datastore emulator). Requires version >= 8. This probably works with JRE, which can be manually downloaded and installed, or let homebrew install JDK:
brew cask install java
To add a migration:
node_modules/.bin/db-migrate create my-cool-migration --config=database.json --migrations-dir=migrations --env=local --sql-file
Then open the new files in migrations/sqls
and
- Add SQL code to make the schema change to the "up" file.
- Add SQL code to undo the schema change to the "down" file.
Problems with migrations?
This is often because db-migration
creates a migration
table in MySQL that tracks what migrations have and have not been applied. When this gets out sync with the code it can break. Often deleting the table has the desired effect.
Some notable test files for patterning new tests:
- /src/state/mockStore.test.js
- Storybook source files are in
src/stories
- Run Storybook
npm run storybook
- http://localhost:9009
- Build Storybook
npm run build-storybook
- Storybook builds to
build/storybook
There's a bug in jest where you can't see console logs unless you run it with
--verbose=false
. Yes, false.
Older versions of enzyme couldn't handle react fragments. When upgrading, ran into this bug which causes npm test
to report a missing babel-preset-react-app
. The current version of react-scripts
requires that @ 7.0.2. Somehow explicitly adding it to package.json @ 7.0.0 fixes the problem. However, now that tests are running again, enzyme still can't process react fragments. 😞