Skip to content

Commit

Permalink
fix: failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
toondaey committed Jul 27, 2023
1 parent d148877 commit a45519e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Test/Unit/CDFPusherTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,6 @@ public async Task TestCreateRelationships()
[Fact]
public async Task TestCreateRawRelationships()
{
using var extractor = tester.BuildExtractor(true, null, pusher);
CommonTestUtils.ResetMetricValue("opcua_node_ensure_failures_cdf");

tester.Config.Cognite.MetadataTargets = new MetadataTargetsConfig
Expand All @@ -1009,13 +1008,15 @@ public async Task TestCreateRawRelationships()
}
};
tester.Config.Extraction.Relationships.Enabled = true;
(handler, pusher) = tester.GetCDFPusher();
using var extractor = tester.BuildExtractor(true, null, pusher);

var assets = Enumerable.Empty<BaseUANode>();
var tss = Enumerable.Empty<UAVariable>();
var update = new UpdateConfig();

// Push none
Assert.True((await pusher.PushNodes(assets, tss, Enumerable.Empty<UAReference>(), update, tester.Source.Token)).References);
Assert.True((await pusher.PushNodes(assets, tss, Enumerable.Empty<UAReference>(), update, tester.Source.Token)).RawReferences);

// Fail to push
var references = new List<UAReference>
Expand All @@ -1027,9 +1028,9 @@ public async Task TestCreateRawRelationships()
handler.FailedRoutes.Add("/raw/dbs/metadata/tables/relationships/rows");
Assert.False((await pusher.PushNodes(assets, tss, references, update, tester.Source.Token)).RawReferences);
Assert.Empty(handler.RelationshipsRaw);
handler.FailedRoutes.Clear();

// Push successful
handler.FailedRoutes.Clear();
Assert.True((await pusher.PushNodes(assets, tss, references, update, tester.Source.Token)).RawReferences);
Assert.Equal(2, handler.RelationshipsRaw.Count);

Expand Down

0 comments on commit a45519e

Please sign in to comment.