The dev ops tech evaluation will replicate a real world scenario. You will be given a boilerplate repository that contains a monorepo project. You will be responsible for creating a github action that will run tests that you create for the the api routes found in the services/example-fastify-cloud-run package.
The boilerplate repo is an example monorepo project. It includes three packages:
libraries/example-messaging-liblibraries/example-utility-libservices/example-fastify-cloud-run
The libraries/example-messaging-lib package is intended to be used as a dependency for the services/example-fastify-cloud-run package. The services/example-fastify-cloud-run package is intended to be deployed to cloud run.
For this assessment, we want to create a github action that is responsible for testing the routes found in services/example-fastify-cloud-run. vitetest is already installed in the project and should be used to set up testing.
-
[] Should be scalable for multiple developers with simultaneous PRs
-
[] Seeding data matching the prisma schema found in
services/example-fastify-cloud-run/schema.prisma -
[] Seeding data into firebase matching the schema found in
libraries/example-messaging-lib/src/index.ts -
[] Testing the following routes from
services/example-fastify-cloud-run/src/index.ts:- []
/api/create_message - []
/api/create_user - []
/api/messages
- []
-
Functionality
-
Scalability
-
Clarity
-
Ability to make small commits with good commit messages
-
Decisions / considerations made in your approach
- Fork the
boilerplaterepo - Run
pnpm install - Run
pnpm run devinservices/example-fastify-cloud-runto start the server - Run
pnpm run testinservices/example-fastify-cloud-runto run the tests
- Create a
.envfile in the root of the repo - You will need to add the following environment variables:
GCP_SERVICE_ACCOUNT = "../../service-account.json"LOCAL_DB_URL = {{ Your local Postgres DB URL }}
- After running
pnpm installand setting up your.envfile with yourLOCAL_DB_URL, runpnpm run migrateto create the database tables
-
From
https://console.firebase.google.com/, you can create a new project -
Complete all three steps
-
- Name your project
-
- Enable Google Analytics
-
- Configure Google Analytics
-
From the project overview page, click the gear icon next to "Project Overview" and select "Project Settings"
-
From the project settings page, select "Service Accounts"
-
From the service accounts page, click "Generate new private key"
-
Rename the downloaded file to
service-account.json, and place it in the root of the repo -
You can add a
.envfile to the root of the repo where you can storeGCP_SERVICE_ACCOUNT="{{path to service-account.json}}"