Merge branch 'main' into ordered-libopenapi

This commit is contained in:
Tristan Cartledge
2023-12-02 22:23:19 +00:00
3 changed files with 1382 additions and 1382 deletions

View File

@@ -562,6 +562,7 @@ func (index *SpecIndex) ExtractComponentsFromRefs(refs []*Reference) []*Referenc
if index.allMappedRefs[ref.FullDefinition] == nil {
found = append(found, located)
index.allMappedRefs[located.FullDefinition] = located
}
rm := &ReferenceMapped{
OriginalReference: ref,
Reference: located,
@@ -569,7 +570,6 @@ func (index *SpecIndex) ExtractComponentsFromRefs(refs []*Reference) []*Referenc
FullDefinition: located.FullDefinition,
}
sequence[refIndex] = rm
}
index.refLock.Unlock()
} else {

View File

@@ -688,8 +688,8 @@ func TestResolver_ResolveComponents_MixedRef(t *testing.T) {
// in v0.8.2 a new check was added when indexing, to prevent re-indexing the same file multiple times.
assert.Equal(t, 6, resolver.GetRelativesSeen())
assert.Equal(t, 5, resolver.GetJourneysTaken())
assert.Equal(t, 7, resolver.GetReferenceVisited())
assert.Equal(t, 6, resolver.GetJourneysTaken())
assert.Equal(t, 8, resolver.GetReferenceVisited())
}
func TestResolver_ResolveComponents_k8s(t *testing.T) {

View File

@@ -538,7 +538,7 @@ func TestSpecIndex_BurgerShop(t *testing.T) {
assert.Len(t, index.allRefs, mappedRefs)
assert.Len(t, index.allMappedRefs, mappedRefs)
assert.Equal(t, mappedRefs, len(index.GetMappedReferences()))
assert.Equal(t, mappedRefs, len(index.GetMappedReferencesSequenced()))
assert.Equal(t, mappedRefs+1, len(index.GetMappedReferencesSequenced()))
assert.Equal(t, 6, index.pathCount)
assert.Equal(t, 6, index.GetPathCount())
@@ -1077,7 +1077,7 @@ func TestSpecIndex_lookupFileReference_MultiRes(t *testing.T) {
assert.NotNil(t, embieRoloFile)
index := rolo.GetRootIndex()
// index.seenRemoteSources = make(map[string]*yaml.Node)
//index.seenRemoteSources = make(map[string]*yaml.Node)
absoluteRef, _ := filepath.Abs("embie.yaml#/naughty")
fRef, _ := index.SearchIndexForReference(absoluteRef)
assert.NotNil(t, fRef)