Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated audit tool and fixed #111 #284

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"AuditDocTestCases",
"CleanSchemaProject",
"CompileSchemaProject",
"CreateTestCases"
"CreateTestCases",
"TestAccurateInvalid"
]
}
},
Expand All @@ -92,7 +93,8 @@
"AuditDocTestCases",
"CleanSchemaProject",
"CompileSchemaProject",
"CreateTestCases"
"CreateTestCases",
"TestAccurateInvalid"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCELEMENTASSEMBLY('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,$,$,$,$,$,$);
#2=IFCSPACE('0eA6m4fELI9QBIhP3wiLAp',$,$,$,'BURROW',$,$,$,$,$,$);
#2=IFCSPACE('0eA6m4fELI9QBIhP3wiLAp',$,$,$,'BURROW',$,$,$,$,.USERDEFINED.,$,$);
#3=IFCRELCONTAINEDINSPATIALSTRUCTURE('05rScmOVzMoQXOfbYdtLYj',$,$,$,(#1),#2);
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FILE_NAME('','2022-10-07T13:48:44',(),(),'IfcOpenShell v0.7.0-dc67287d','IfcOpen
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCFURNITURE('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,'WATERBOTTLE',$,$,$,$);
#1=IFCFURNITURE('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,'WATERBOTTLE',$,$,$,.USERDEFINED.);
#2=IFCDISCRETEACCESSORY('0eA6m4fELI9QBIhP3wiLAp',$,$,$,$,$,$,$,$);
#3=IFCRELNESTS('05rScmOVzMoQXOfbYdtLYj',$,$,$,#1,(#2));
ENDSEC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCELEMENTASSEMBLY('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,$,$,$,$,$,$);
#2=IFCINVENTORY('0eA6m4fELI9QBIhP3wiLAp',$,$,$,'BUNNY',$,$,$,$,$,$);
#2=IFCINVENTORY('0eA6m4fELI9QBIhP3wiLAp',$,$,$,'BUNNY',.USERDEFINED.,$,$,$,$,$);
#3=IFCRELASSIGNSTOGROUP('05rScmOVzMoQXOfbYdtLYj',$,$,$,(#1),$,#2);
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCELEMENTASSEMBLY('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,$,$,$,$,$,$);
#2=IFCINVENTORY('0eA6m4fELI9QBIhP3wiLAp',$,$,$,'BUNNY',$,$,$,$,$,$);
#2=IFCINVENTORY('0eA6m4fELI9QBIhP3wiLAp',$,$,$,'BUNNY',.USERDEFINED.,$,$,$,$,$);
#3=IFCRELASSIGNSTOGROUP('05rScmOVzMoQXOfbYdtLYj',$,$,$,(#1),$,#2);
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCELEMENTASSEMBLY('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,$,$,$,$,$,$);
#2=IFCSPACE('0eA6m4fELI9QBIhP3wiLAp',$,$,$,'BURROW',$,$,$,$,$,$);
#2=IFCSPACE('0eA6m4fELI9QBIhP3wiLAp',$,$,$,'BURROW',$,$,$,$,.USERDEFINED.,$);
#3=IFCRELCONTAINEDINSPATIALSTRUCTURE('05rScmOVzMoQXOfbYdtLYj',$,$,$,(#1),#2);
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FILE_NAME('','2022-10-07T13:48:44',(),(),'IfcOpenShell v0.7.0-dc67287d','IfcOpen
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCFURNITURE('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,'WATERBOTTLE',$,$,$,$);
#1=IFCFURNITURE('1hqIFTRjfV6AWq_bMtnZwI',$,$,$,'WATERBOTTLE',$,$,$,.USERDEFINED.);
#2=IFCDISCRETEACCESSORY('0eA6m4fELI9QBIhP3wiLAp',$,$,$,$,$,$,$,$);
#3=IFCRELNESTS('05rScmOVzMoQXOfbYdtLYj',$,$,$,#1,(#2));
ENDSEC;
Expand Down
50 changes: 44 additions & 6 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class Build : NukeBuild
{
public static int Main() => Execute<Build>(x => x.AuditAllIdsFiles);

[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
private readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;

Expand Down Expand Up @@ -184,15 +184,53 @@ class Build : NukeBuild
var inputFolder = RootDirectory / "Documentation" / "testcases";
var arguments = $"audit \"{inputFolder}\" --omitContentAuditPattern \"[\\\\|/]invalid-\" -x \"{schemaFile}\"";
IdsTool(arguments, workingDirectory: IdsToolPath);
});
});

/// <summary>
/// Perform all quality assurance of published IDS files; this is the one invoked by default
/// </summary>
Target AuditAllIdsFiles => _ => _
/// <summary>
/// Audits the validity of Documentation/testcases folder in the repository, using ids-tool.
/// The tool is deployed by the annotated <see cref="IdsTool"/>.
/// The schema is loaded from the repository to ensure internal coherence.
/// </summary>
Target TestAccurateInvalid => _ => _
.AssuredAfterFailure()
.Executes(() =>
{
// we are omitting tests on the content of the Documentation/testcases folder,
// because they include IDSs that intentionally contain errors
//
// todo: once stable, this could be improved to omit contents based on failure patter name
// todo: once stable, constrained on expected auditing failures on the "fail-" cases should be added
var schemaFile = RootDirectory / "Development" / "ids.xsd";
var inputFolder = RootDirectory / "Documentation" / "testcases";

DirectoryInfo d = new DirectoryInfo(inputFolder);
foreach (var invalidFile in d.GetFiles("invalid-*.ids", SearchOption.AllDirectories))
{
Console.WriteLine(invalidFile.FullName);
var arguments = $"audit \"{invalidFile}\" -x \"{schemaFile}\"";
try
{
var t = IdsTool(arguments, workingDirectory: IdsToolPath);
}
catch (ProcessException ex)
{
if (ex.ExitCode != 16)
throw new Exception("Unexpected exit code");

}
}


});

/// <summary>
/// Perform all quality assurance of published IDS files; this is the one invoked by default
/// </summary>
Target AuditAllIdsFiles => _ => _
.AssuredAfterFailure()
.DependsOn(AuditDocTestCases)
.DependsOn(AuditDevelopment)
.DependsOn(TestAccurateInvalid)
.Executes(() =>
{
Console.WriteLine("This is an utility target that launches all available IDS auditing targets.");
Expand Down
2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="6.3.0" />
<PackageReference Include="ids-tool.CommandLine" Version="1.0.72" />
<PackageReference Include="ids-tool.CommandLine" Version="1.0.73" />
<PackageDownload Include="dotnet-xscgen" Version="[2.1.1094]" />
</ItemGroup>

Expand Down
Loading