Best practices developing teststeps with plugin dependencies

What is the best/recommended way to develop a teststep that will depend on other plugins (ie DUT, Instrument)?
So far I have…

  1. Install the other plugins in the OpenTAP installation of the teststep VS project?
  2. Add reference(s) to the other plugin assemblies?
  3. Develop/debug your teststep plugin
  4. Add the other plugins to package.xml as Dependencies. This has to be done manually? From the doc I get the impression Package Manager should do this:
    The dependency and version information added by the Package Manager allows it to determine whether all prerequisites have been met when trying to install the package on the client
  5. Build in Release config and distribute…
3 Likes

@GoranJohnsson this has gotten much better in recent releases with the introduction of the OpenTAP Nuget package.

  1. Rather than explicitly requiring the plugin to be installed, we recommend updating your csproj file to include plugin references and dependencies. This allows you to build a clean container environment with only the required plugins vs everything you have ever installed:
    Getting Started | OpenTAP
    This makes the package install part of your build project so it can be built on any system.
  2. Add references to other plugin assemblies, using the relative path (not full paths)
  3. Develop/Debug
  4. By implementing step 1, this step will be handled automatically, but you can also explicitly define if you want more flexible dependencies (9.1 or above, etc):
  5. Build in Release
1 Like

@brennen_direnzo Great, thanks.
For #1 I meant only the plugins required for the plugin project and then in #2 add a reference to the plugins from #1.
What other plugin assemblies are you referring to in #2?

When editing .csproj you don’t get any code completion help for the OpenTAP specific elements (OpenTapPckagreReference, AdditionalOpenTapPackage…), right?

There are no new assemblies in #2, it is just the normal .NET Assembly Reference. Just your reference is from your debug environment rather than your install directory (then get installed from step 1)

And correct, today when editing the csproj there is no code completion.

1 Like

@brennen_direnzo OK.
How about adding a couple of example OpenTapPackageReference/ AdditionalOpenTapPackage elements (commented out) in the default .csproj template file?

Today, there are a few things, are you looking for something more than this?:

 <ItemGroup>
    <!-- Developer's System is needed to debug in 'Editor' -->
    <AdditionalOpenTapPackage Include="Developer's System" />

    <!--<AdditionalOpenTapPackage Include="Developer's System CE" />-->
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="OpenTAP" Version="9.13.0" />
  </ItemGroup>

Since there is no code completion assistance for the OpenTAP specific elements I would like to also include some examples for OpenTapPackageReferensce & AdditionalOpenTapPackage incl. available attributes.

Ok makes sense. I added this issue here: Add Examples and Templates for using OpenTapPackageReference and AdditionalOpenTapPackage (#663) · Issues · OpenTAP / OpenTAP · GitLab

1 Like