Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atlas-mock-proxy-server

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atlas-mock-proxy-server

A Node.js based mock server for OTT services.

  • 2.11.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Atlas Mock Proxy Server

A Node.js based mock server for OTT services.

Starting

Make sure you have run yarn at the root of the repo to install node modules.

To start the server run:

yarn start

To start up the server in development mode run:

yarn dev

Visit http://localhost:5000/

Running Mock Proxy Server on HTTPS locally for on device automation tests

Full documentation can be found here

Adding mocks

You shouldn't need to add a new Koa route handler function for every mock that you add.

To add new mocks, add a route to routes/index.js. If you're adding mocks for ATOM, note that we use wildcard URLs to simplify things:

  1. Work out if you're adding a group, collection, slug, or any other ATOM node
  2. Add the fixture file to fixtures/pcms/<type>
  3. Update the corresponding index file with the partial URL
  '1a042ec6-ad93-11e6-b0fc-0f6df31ff06a': require('./ie/standalone-entertainment-asset-details'),

The route in routes/index.js that matches this is /v3/query/node/:node*.

Delaying the server to simulate a slow environment

MOCK_PROXY_DELAY=2000 yarn dev

Updating graphql mocks and schema

Whenever graphql is update we should be updating the mocks used. To do this we will need to run queries against a graphql server using to this mock proxy server as pcms, search and so on, and then update the mocks with the new responses. There is an automated way to do this:

  • start the mock proxy yarn start
  • run the yarn atlas-mock command on https://github.com/sky-uk/ott-graphql repo (updated master), this spins up a local apollo instance pointing to mock proxy at localhost:5000
  • run the command yarn update-graphql, this will update both the schema and the existing mocks automatically

Labels

Creating labels

yarn build-labels

This will take the label keys + values from each client's mock.jc.en.json, and produce an updated keys.csv. This keys.csv file lists the label key, what interpolations there are (if any), and if the label is plural. If a label is removed from a client's mock.jc.en.json it will be removed from keys.csv. These files get uploaded to ATOM for all PPTs on a master build, where we will then go in and update the values as necessary. concourse/pipeline/jobs/tasks/upload-label-keys.sh is the concourse job that uploads the CSV file to ATOM.

Updating labels - AppleTV (deprecated)

TERRITORY={territory} LANGUAGE={language} PROPOSITION={proposition} CLIENT={client} yarn update-labels

This will run a script over fixtures/pcms/labelling-feed/{client}/{proposition}.{territory}.{language}.json and create update-labels/Default-Messages.xlsx which can be uploaded from the deprecated-upload-labels job on Jenkins, or from upload-labels.sh.

Client specific labels

The values for client are WEB, TV or APPLETV. The labels are built for each of these clients and there are corresponding directories, for example fixtures/pcms/labelling-feed/tv. When editing labels or adding labels they should be done inside the correct client.

FAQs

Package last updated on 12 Sep 2019

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