Contributors must follow Code of Conduct.
Contributing to this project can be done through pull requests or raising issues. If you are contributing code, please follow the steps below to ensure that:
- Target packages and dependent components are compatible with the versions supported by this project.
- All unit tests and integration tests pass.
- Contribution is aligned with the function and spirit of the current project.
Pull the code from the repo:
git clone https://github.com/TDAmeritrade/botbuilder-storage-postgres.git
Install packages
npm install
Note: You do not need TypeScript installed globally. The project installs the TypeScript compiler locally and uses it in the build process.
Run all unit tests
npm run test:unit
Unit tests are written in pure JavaScript. The npm test:unit
script executes tsc
then invokes nyc
npm run cover
There is no need to execute 'npm run test:unit' before code coverage. The cover command performs the following:
- Builds via the TypeScript compiler (
tsc
). - Runs run unit tests.
- Creates an html report in the cover folder.
- Opens a browser window with html report.
Run a local postgres instance in order to perform integration tests. There are many ways to run postgres locally, and you may already be running Mongo on your computer.
Note that the integration tests are hard-coded to run with the following settings:
const settings = { uri: 'postgresql://localhost:5432/botbuilderPostgresTestDb' };Please ensure that the database and collection names do not overwrite your data! This is up to you!!!
_ DOCKER IMAGE SORCERY FOR THE FUTURE _
If using docker, you can run a local instance by issuing the following command
docker run --name something --flerp toop
The command above will name your container instance mongo-local-v40 and use the 4.0
postgres version.
If your computer is already running a postgres server instance, you would need to stop it or run it on different TCP port.
Please don't modify the
settings
object in the integration tests. Our automated builds will fail and cause your PR to be rejected.
Once you have postgres running, ensure all integration tests pass:
npm run test:integration
[TBD]
Use the [TBD] template and ensure the PR complies with all requested information.