question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI without ID proposal

See original GitHub issue

Our current CLI relies on test IDs to run (instead of create and run) tests, so it saves the test ID to the definition file. This makes the tests non portable; meaning, a test created on one instance will fail to run on a different instance.

To fix this, we can add a name that acts as a user defined ID. This will exist in parallel to our current Test ID, which is used in the web UI.

Example:

To run a new test:

tracetest test run --definition ./file.yml --name 'my-unique-name'

This will result in a new test being created, with the User Defined ID set to my-unique-name. The ./file.yml definition file is left untouched. Successive calls to the same server will result in a test run without a new test being created.

Now, if the same command is executed with the CLI pointing to a different instance, the same process will repeat: first call will create a new test, successive calls creates new runs for the same test.

A name must be unique within an instance, and be a valid, one line string. It will be used to uniquely identify a test in a way that is agnostic to the instance.

Example of valid names:

  • some test name
  • some-test-name
  • represent/some/dir/structure

Run an entire directory

With this new approach, we could have a run -r ./somedir/ command, that can recursively read a directory, and create a run for each yaml file found, using the file name without the extension as the name

Example structure:

tracetest/
|- cart
|  |- add-to-cart.yaml
|  |- checkout.yaml
|- signup
|  |- success.yaml
|  |- error.yaml

Example command:

tracetest run -r ./tracetest/

This command would be equivalent to running the following commands:

tracetest run --definition ./tracetest/cart/add-to-cart.yaml --name cart/add-to-cart
tracetest run --definition ./tracetest/cart/checkout.yaml --name cart/checkout
tracetest run --definition ./tracetest/signup/success.yaml --name signup/success
tracetest run --definition ./tracetest/signup/error.yaml --name signup/error

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
schorencommented, Jun 17, 2022
  1. name: I think this was not a great word choice on my part. My idea was to left the current implementation untouched, and just add new things. So, this new name should NOT be the same as the current, web displayed name. I thought of using id, but that still conflicts with existing fields. Maybe we could use key?

  2. version: text files don’t support version at the moment, and I think it should stay that way. The idea of text files is to enable git based workflows, so running a text file should update the test version, and text files should always be considered “latest”. I don’t imagine a workflow where a user would want to run an older version of a test from the CLI

0reactions
kdhamriccommented, Jun 17, 2022

I would think we would allow a user to specify either the id or the name to run a test via the command line.

Read more comments on GitHub >

github_iconTop Results From Across the Web

create-proposal — AWS CLI 1.27.37 Command Reference
A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time....
Read more >
get-proposal — AWS CLI 2.9.5 Command Reference
The unique identifier of the network for which the proposal is made. --proposal-id (string). The unique identifier of the proposal.
Read more >
Proposal: Resource Exclusion · Issue #451 · auth0 ... - GitHub
They only apply on a per-ID basis, meaning that there is no way to automatically exclude all of that certain resource.
Read more >
NEAR CLI | NEAR Documentation - NEAR docs
The NEAR Command Line Interface (CLI) is a tool that enables to ... --contract-id is the contract you are allowing methods to be...
Read more >
Delegator Guide (CLI) - Cosmos Hub
Any bonded Atom holder can then cast a vote on this proposal. The options are Yes , No , NoWithVeto and Abstain ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found