Skip to content
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

feat: add tunnel-timeout flag #8

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
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
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,34 @@ It can be used as a command, or as a job.\
Both are called `saucectl-run`.

> You need to have set the following environment variables to be able to run saucectl:
>
> - SAUCE_USERNAME
> - SAUCE_ACCESS_KEY

Alternatively, you can use the `sauce-username` and `sauce-access-key` parameters of the orb.

## Parameters

| Parameter name | Description | Default value |
| --- | --- | --- |
| sauce-username | Sauce Username to use for authentification | |
| sauce-access-key | Sauce Access Key to use for authentification | |
| saucectl-version | Version of saucectl to use. Example: v0.68.2 | `latest` |
| config-file | Configuration file to use with saucectl | `.sauce/config.yml` |
| working-directory | Working directory to use when running saucectl | `.` |
| region | Region to pass to saucectl | |
| select-suite | Run a particular suite instead of all | |
| show-console-log | Show console log when suite succeed | `false` |
| env | Environment variable to pass to saucectl | |
| sauceignore | Sauceignore file to be used | |
| timeout | Test timeout in seconds | |
| tunnel-name | Sets the sauce-connect tunnel name to be used for the run | |
| tunnel-owner | Sets the sauce-connect tunnel owner to be used for the run | |
| ccy | Sets the concurrency to be used for the run | |
| retries | Sets the number of retries to do for the run | |
| test-env-silent | Skips the test environment announcement | `false` |
| async | Launches tests without awaiting outcomes; operates in a fire-and-forget manner | `false` |
| Parameter name | Description | Default value |
| ----------------- | ------------------------------------------------------------------------------ | ------------------- |
| sauce-username | Sauce Username to use for authentification | |
| sauce-access-key | Sauce Access Key to use for authentification | |
| saucectl-version | Version of saucectl to use. Example: v0.68.2 | `latest` |
| config-file | Configuration file to use with saucectl | `.sauce/config.yml` |
| working-directory | Working directory to use when running saucectl | `.` |
| region | Region to pass to saucectl | |
| select-suite | Run a particular suite instead of all | |
| show-console-log | Show console log when suite succeed | `false` |
| env | Environment variable to pass to saucectl | |
| sauceignore | Sauceignore file to be used | |
| timeout | Test timeout in seconds | |
| tunnel-name | Sets the sauce-connect tunnel name to be used for the run | |
| tunnel-owner | Sets the sauce-connect tunnel owner to be used for the run | |
| tunnel-timeout | How long to wait for the specified tunnel to be ready | |
| ccy | Sets the concurrency to be used for the run | |
| retries | Sets the number of retries to do for the run | |
| test-env-silent | Skips the test environment announcement | `false` |
| async | Launches tests without awaiting outcomes; operates in a fire-and-forget manner | `false` |

## Example

Expand Down
7 changes: 6 additions & 1 deletion src/commands/saucectl-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ parameters:
default: false
env:
type: string
description: Environment variables to pass to saucectl.
description: Environment variables to pass to saucectl.
default: ""
sauceignore:
type: string
Expand All @@ -58,6 +58,10 @@ parameters:
type: string
description: Sets the sauce-connect tunnel parent to be used for the run.
default: ""
tunnel-timeout:
type: string
description: How long to wait for the specified tunnel to be ready. Supports duration values like '10s', '30m' etc.
default: ""
ccy:
type: string
description: Sets the concurrency to be used for the run.
Expand Down Expand Up @@ -91,6 +95,7 @@ steps:
PARAM_TIMEOUT: <<parameters.timeout>>
PARAM_TUNNEL_NAME: <<parameters.tunnel-name>>
PARAM_TUNNEL_OWNER: <<parameters.tunnel-owner>>
PARAM_TUNNEL_TIMEOUT: <<parameters.tunnel-timeout>>
PARAM_CCY: <<parameters.ccy>>
PARAM_RETRIES: <<parameters.retries>>
PARAM_TEST_ENV_SILENT: <<parameters.test-env-silent>>
Expand Down
6 changes: 5 additions & 1 deletion src/scripts/saucectl-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ install() {

platform=${platforms[$src_platform]}
arch=${archs[$src_arch]}

# Check value
if [ -z "${platform}" ] || [ -z "${arch}" ]; then
echo "Unexpected platform (${src_platform} / ${platform}) or arch (${src_arch} / ${arch})"
Expand Down Expand Up @@ -102,6 +102,10 @@ parse_args() {
ARGS+=("--tunnel-owner" "${PARAM_TUNNEL_OWNER}")
fi

if [ -n "${PARAM_TUNNEL_TIMEOUT}" ];then
ARGS+=("--tunnel-timeout" "${PARAM_TUNNEL_TIMEOUT}")
fi

if [ -n "${PARAM_CCY}" ];then
ARGS+=("--ccy" "${PARAM_CCY}")
fi
Expand Down