New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/software-engr-full-stack/backend-developer-tests

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/software-engr-full-stack/backend-developer-tests

  • v0.0.0-20220623031406-f1d9868c696b
  • Source
  • Go
  • Socket score

Version published
Created
Source

About

Answers to stackpath.com's Backend Developer Tests

Original README

Answers

Unit Testing

The answer is just one test file located here.

Web Services

The core answer is in the people.go file inside the rest-api/pkg/handlers sub-directory. But I've thrown a bunch of extras so the answer to this test is pretty much the whole rest-service sub-directory. Extras:

  1. Lots of tests for the main handler in the rest-api/pkg/handlers sub-directory.

  2. The service is deployed using AWS Lambda. The endpoint is here. cd into rest-service/cmd/microservice/deploy, then run make test to test the different scenarios (GET /people, GET /people/?first_name=...&last_name=...) specified in the test against the endpoint. I used Terraform to provision the AWS resources. The Terraform code is located here.

  3. Instrumentation and metrics gathering using Prometheus and Grafana. Some of the metrics gathered are total number of requests and response time. Use the term stackpath_dev_tests in Grafana's Metrics Browser to filter the custom metrics I've added. For now, this only works locally.

Grafana
  1. cd into rest-service, then run docker compose up. This command will run the REST service, Prometheus, Grafana, and Node Exporter inside containers. Once the containers are running, proceed to the next steps.

  2. Open your browser to http://localhost:3030/. This is the Grafana portal. The default log in username and password is admin.

  3. Once you're logged in, click on "Add your first data source", then click on "Prometheus", then enter "http://prometheus:9090" in the HTTP URL text box. Click on "Save & Test" button located below. If everything works, you should see a green check mark "Data source is working" status message.

  4. Click on "Explore" on the side bar (compass icon), click on "Metrics Browser", then enter "stackpath_dev_tests" in the "Select a metric" text box. Click on a metric to see information and graphs about that metric.

Input Processing

The answer and the test file.

Concurrency

Here is the answer to the simple pool test.

FAQs

Package last updated on 23 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc