Skip to content

WinTPS v2 ideas #55

@RadekCap

Description

@RadekCap

Current status

  • V1
  • Installation, uninstallation, default, all - demonstrate the format

We are covering several main areas

  • install & uninstall
  • checking of installed files on the filesystem
  • checking of proper system variables setup
  • checking of proper registry values

Why
I would like to use a more robust testing approach than bash. It's possible to write it in nUnit/junit or something similar. Aside from robustness, we'll get significantly higher testing coverage due to the creation of testing installation variants.

  • current testing isn't robust
  • a new addition needs a lot of boilerplate code
  • significantly easier maintenance

Draft of implementation in nunit with TestCaseSource

public class WinTPSTests
{
   // SetUp
   // installation for every combination


   [TestCaseSource(typeof(VendorConfiguration))]
   public void CheckRegistryInstallation(VendorConfiguration configuration)
   {
       // foreach RegistyPaths in configuration && current JavaVersion
       Assert.AreEqual(configuration.Registry, actualRegistryValue);
   }


   [TestCaseSource(typeof(VendorConfiguration))]
   public void CheckFilesInstallation(VendorConfiguration configuration)
   {
       // foreach Files in configuration && current JavaVersion
       Assert.AreTrue(File.Exists(configuration.File));
   }


   // TearDown for every combination
}


public class VendorConfiguration : IEnumerable
{
   public IEnumerator GetEnumerator()
   {
       yield return new VendorSpecificConfiguration[]
       {
         Feature = "FeatureEnvironment",
         new List<Path>() { "ABC", "XYZ"},
         new List<String>() {"RegistryPath1", "RegistryPath2"}
         JavaVersion = 20
       };


       yield return new VendorSpecificConfiguration[]
       {
         Feature = "FeatureJavaHome",
         new List<Path>() { "ABC", "XYZ"},
         new List<String>() {"RegistryPath1", "RegistryPath2"} 
         JavaVersion = 20
       };


       yield return new VendorSpecificConfiguration[]
       {
         Feature = "FeatureJarFileRunWith",
         new List<Path>() { "ABC", "XYZ"},
         new List<String>() {"RegistryPath1", "RegistryPath2"} 
         JavaVersion = 20
       };
   }
}


public class VendorSpecificConfiguration
{
 public IEnumerator GetEnumerator()
 {
     string Feature;
     List<Path> Files;
     List<String> RegistyPaths;
     int JavaVersion;
 }
}

What’s missing?
https://github.com/adoptium/installer/blob/master/wix/README.md#features-available

  • Reinstall?
  • Per user installation?
  • Upgrade?
  • Do we need some runnable application?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions