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

dcc-server-tester

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dcc-server-tester

A server to process media submitted to lightover

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
0
Weekly downloads
 
Created
Source

DCC-Server-Tester

The DCC-Server-Tester is a test script that you can easily run against your server deployment. Tests can either be run locally, or for more production-scale tests, they can be run using AWS lambda.

Preparing to test

1. Install Node.js

The dcc-server-tester runs using Node.js. Follow the instructions to install Node.js to get started.

2. Setup a test Email via the DCC Dashboard

First, navigate to the server dashboard you wish to test (for example https://dashboard.dcconsortium.org). Click "Upload and Prepare Batch"

The DCC Dashboard

Create a name for your test batch (for example, "Test 7"), and select any available template you wish to test. On the "Upload & Manage Earner Information" page, upload a CSV with one line that contains your email. For example, you could copy the CSV below and replace john@example.com with your personal email.

earnerName,degreeType,subject,credentialName,emailAddress
John Doe,Bachelor of Science,Computer Science,Bachelors,john@example.com

Select an email template. On the final "Confirmation" page, press "Send." This should send an email with a link to your personal email (like the one below.) Copy the emailed link and save it for later.

Email link from the dashboard

Running Tests

Running tests locally requires minimal setup. You can use the dcc-server-tester library by simply running the command below, replacing {EMAILED_URL} and {DASHBOARD_URL} with your personal information.

npx dcc-server-tester test -e "{EMAILED_URL}" -d "{DASHBOARD_URL}" -s "1" -r "1"

The dcc-server-tester CLI has one command, "test," and it has the following parameters:

ParamDescriptionExampleDefault
-e or --emailed_urlThe URL emailed to you in the step above.https://load-test.dcconsortium.org/claim/?token=ey...none
-d or --dashboard_urlThe URL of the dashboard you wish to testhttps://load-test.dcconsortium.orgnone
-s or --secondsThe number of seconds you want your test to run2001
-r or --rateThe number of simulated users per second you want1001
-a or --awsAdd this flag to run your tests on AWS Lambda

Running tests with AWS Lambda

Get Access Keys for AWS

AWS Lambda uses Amazon servers to run your tests. This lets us use a beefy data-center network to send thousands of requests. But, before we run the tests, we need to set up your Amazon account.

First go to https://aws.amazon.com/ and create an account if you have not already.

In the search bar on the AWS console, search "IAM" and choose "IAM"

Select IAM in the AWS search console

Once you've activated IAM, select the "user" link in the side menu and click "Create User."

On the next screen, you can name the user anything (for example cli-user).

Create a new user

On the "Set Permissions" screen, select the "Attach policies directly" option, search "administratorAccess" in the search box, and select the "AdministratorAccess" policy.

Add admin permissions to the user

Review the options and click "Create User."

Back on the "User" pane, click on the user you just created.

Click on the user you just created

Now, we need to generate keys that we will use to let the dcc-server-tester access this user. To do this, click the "Create Access Key" link.

Select Create Access Key

Select "Command Line Interface (CLI)" from the options.

Select "Command Line Interface (CLI)"

Once you've created the key, copy the "Access Key" and "Secret access key" and save it for later. You will not be able to retrieve these keys once you naviage away from this screen.

Select Create Access Key

Configure the AWS CLI

Now we want to set up the AWS CLI on your local machine. When you run the dcc-server-tester it will look for the AWS CLI and use it to deploy your tests to AWS Lambda.

To install the AWS CLI, follow the installation instructions for your platform.

Now, run the aws configure command. You will be prompted to provide a AWS Access Key and AWS Access Secret Key. Use the ones we generated in the previous section.

Run the Tests

Now, we can run the tests using AWS Lambda. To do so, we can run the same command, but provide the "-a" flag to indicate we want the tests to run on AWS. For example:

npx dcc-server-tester test -e "{EMAILED_URL}" -d "{DASHBOARD_URL}" -s "1" -r "1" -a

FAQs

Package last updated on 24 Jun 2024

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