Giter Site home page Giter Site logo

Comments (5)

mathse avatar mathse commented on May 27, 2024

also config.common.xml needs to be in C:\Tools\AutoTx
but autotxconfigtest.exe does NOT complain about this file is missing

PS C:\Tools\AutoTx\conf> ..\AutoTxConfigTest.exe

Trying to parse configuration files from [C:\Tools\AutoTx\]...

[Error] mandatory parameter missing: <IncomingDirectory>
System.Configuration.ConfigurationErrorsException: mandatory parameter missing: <IncomingDirectory>
   at ATxCommon.Serializables.ServiceConfig.<ValidateConfiguration>g__CheckEmpty|152_0(String value, String name)
   at ATxCommon.Serializables.ServiceConfig.ValidateConfiguration(ServiceConfig c)
   at ATxCommon.Serializables.ServiceConfig.Deserialize(String path)
   at ATxConfigTest.AutoTxConfigTest.Main(String[] args)

from auto-tx.

mathse avatar mathse commented on May 27, 2024

AutoTxConfigTest.exe is look for the config in the same folder as the exe file - not mentioned in the documentation

from auto-tx.

ehrenfeu avatar ehrenfeu commented on May 27, 2024

Hi @mathse,

thanks for the feedback. Actually, AutoTxConfigText.exe is looking in its own location for the configuration files to check only if nothing is specified on the command line. This is done using a very simple approach in the Main() method as seen here (no smart command line parameter parsing at all!):

var baseDir = AppDomain.CurrentDomain.BaseDirectory;
if (args.Length > 0)
baseDir = args[0];

The tool was created to be used by the Update-Service.ps1 script, where it is used in the Config-IsValid function (see line 384 for the call):

function Config-IsValid {
# Check if the new configuration provided at $UpdPathConfig validates with
# the appropriate "AutoTxConfigTest" binary (either the existing one in the
# service installation directory (if the service binaries won't be updated)
# or the new one at the $UpdPathBinaries location in case the service itself
# will be updated as well).
#
# Returns an array with two elements, the first one being $True in case the
# configuration was successfully validated ($False otherwise) and the second
# one containing the output of the configuration test tool as a string.
Param (
[Parameter(Mandatory=$True)]
[ValidateScript({(Test-Path $_ -PathType Leaf)})]
[String]$ConfigTest,
[Parameter(Mandatory=$True)]
[ValidateScript({(Test-Path $_ -PathType Container)})]
[String]$ConfigPath
)
Write-Verbose "Running [$($ConfigTest) $($ConfigPath)]..."
$Summary = & $ConfigTest $ConfigPath
$Ret = $?
# pipe through Out-String to preserve line breaks:
$Summary = "$("=" * 80)`n$($Summary | Out-String)`n$("=" * 80)"
if ($Ret) {
Log-Debug "Validated config files at [$($ConfigPath)]:`n$($Summary)"
Return $Ret, $Summary
}
Log-Error "Config at [$($ConfigPath)] FAILED VALIDATION:`n$($Summary)"
Return $Ret, $Summary
}

However, the tool is also intended for direct use on the command line. So this should indeed be documented better, and it would definitely be smarter to look in the (new) default location for the config files. Forgot to reflect this when changing the config location and never ran into problems myself since the updater is calling configtest with an explicit path...

Cheers,
Niko

from auto-tx.

ehrenfeu avatar ehrenfeu commented on May 27, 2024

Just for completeness:

AutoTxConfigTest.exe is look for the config in the same folder as the exe file - not mentioned in the documentation

this behavior is explained in the corresponding README here:

By default, configuration files are expected to be in the same directory as the
`AutoTxConfigTest` executable. In that case simply run the tool like this:

If you have any suggestions where else this should be mentioned, please let me know - happy to update the documentation about this!

from auto-tx.

ehrenfeu avatar ehrenfeu commented on May 27, 2024

With commit 3752c5e the configuration tester is now looking in the var/ subfolder for the config files by default.

from auto-tx.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.