Skip to content

Conversation

@severussundar
Copy link
Contributor

@severussundar severussundar commented Oct 31, 2022

What is this change?

  • A file containing the commands to generate the default config file dab-config.json is added
  • The scripts are updated to read and execute commands from this newly added file.
  • The contents of the ConfigGenerators are added to the sln file. Now, the command files and scripts show up in Visual Studio. Earlier, they were not, and the commands/scripts had to be edited using another text editor/IDE.

How was this tested?

  • Existing Integration Tests and Unit Tests run successfully

Copy link
Contributor

@seantleonard seantleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions/concerns

Copy link
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a reason to generate the default config

@severussundar severussundar modified the milestones: Oct2022, Nov2022 Nov 1, 2022
Comment on lines +11 to +12
..\ConfigGenerators\configGenerator.ps1 = ..\ConfigGenerators\configGenerator.ps1
..\ConfigGenerators\configGenerator.sh = ..\ConfigGenerators\configGenerator.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Visual Studio smart enough to know which of these to run per platform? or do both attempt to run?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, are these just file references for what is in the solution? I'm not recognizing why these lines are added to this file/what the significance is.

// Test to verify the engine gets started using start command
// </summary>
/// <summary>
/// Test to verify the engine starts with the right log level using start command
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Test to verify the engine starts with the right log level using start command
/// Test to verify the engine starts with the log level specified in the start command

This is what is meant, yes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly! Will update

Copy link
Contributor

@seantleonard seantleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more questions

[DataRow("--LogLevel CrItIcal", false, true, DisplayName = "Case sensitivity: LogLevel Critical from command line.")]
[DataRow("--LogLevel NONE", false, true, DisplayName = "Case sensitivity: LogLevel None from command line.")]
public void TestStartEngine(string logging, bool useDefaultConfig, bool expectSuccess)
public void TestStartEngine(string logging, bool useInvalidConfig, bool expectSuccess)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add parameter comments to the test summary?

  • Define how useInvalidConfig is relevant to testing the logging level detected during startup

public static string _testRuntimeConfig = "dab-config-test.json";

// Name of an invalid config file that can be used for tests.
public static string InvalidConfigFileName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elaborate in comment what you are trying to achieve with an invalid config file name.

  • Are you trying to get the engine to start without a config file and if so, could the same behavior be achieved by using option --config with no value?

Comment on lines +11 to +14
get
{
return "dab-config.invalid.json";
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason you chose property/getter vs. constant?

SO discussion ( just for consideration, I'm not suggesting one implementation vs. another)

public const string CONFIG_WITH_SINGLE_ENTITY = @"
{
""$schema"": ""dab.draft-01.schema.json"",
""$schema"": ""dab.draft.schema.json"",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use the const that you defined elsewhere in this PR: SCHEMA ?

{
private static RestService _restService;
private static string _testCategory = "mssql";
private static string _testCategory = "MsSql";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this variable necessary? could you use TestCategory.MSSQL instead of _testCategory ?

Comment on lines +11 to +12
..\ConfigGenerators\configGenerator.ps1 = ..\ConfigGenerators\configGenerator.ps1
..\ConfigGenerators\configGenerator.sh = ..\ConfigGenerators\configGenerator.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, are these just file references for what is in the solution? I'm not recognizing why these lines are added to this file/what the significance is.

@severussundar
Copy link
Contributor Author

Closing this as PR 981 takes care of the changes present in this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config changes related to config

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants