Skip to content

Readme updates to show others how to test locally. #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: mainline
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This repository provides a number of scripts that can be used to bundle a WireMo

## Contents
* [Running the Test Server](#running-the-test-server)
* [Running Tests Locally](#running-tests-locally)
* [Creating Scenarios](#creating-scenarios)
* [Bundling Packages](#bundling-packages)
* [Releasing a Package](#releasing-a-package)
Expand All @@ -30,6 +31,35 @@ Once the server is running, you can run the mock API tests for your SDK. See the

You can check which scenarios are included in the package by referencing the package's [README](https://github.com/smartsheet/smartsheet-sdk-tests/blob/master/sdk_tests_package/README.md). This README includes information on how to run the server as well as descriptions of each scenario.

## Running Tests Locally
To run the tests locally you need to just set up a few scripts that start wiremock and then run the tests.

### Example start wire mock shell script locally.
```bash
#!/usr/bin/env sh
#This is just the install and start wiremock scripts combined.
set -e
WIREMOCK_PACKAGE="./sdk_tests_package" #or path to sdk_tests_package directory
cp -r "$WIREMOCK_PACKAGE" .
WIREMOCK_PACKAGE_DIR='sdk_tests_package'

# run wiremock
(cd $WIREMOCK_PACKAGE_DIR; ./launch.sh &)

# wait for wiremock to start
sleep 10
```

### Running Tests Locally
```bash
#!/bin/bash

cd ../smartsheet-csharp-sdk/mock-api-test-sdk-net60/
dotnet restore
dotnet build --configuration Release --no-restore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on a fresh fork i had to run dotnet restore before this build would work

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add it to the script. Thanks for testing!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK @rzaracota should be better now. Feel free to take a look.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just manually verified these steps from a new clone!

dotnet test --no-restore
```

## Creating Scenarios
Scenarios can either be written by hand following the [scenario spec](#scenario-specification) or by [converting a Postman collections export file](#converting-postman-export-files). In order to use the new scenarios, the scenario file(s) must be added to the `data/scenarios` directory and the package must be rebundled - see [bundling packages](#bundling-packages).

Expand Down