...

Source file src/go.mongodb.org/mongo-driver/mongo/description/max_staleness_spec_test.go

Documentation: go.mongodb.org/mongo-driver/mongo/description

     1  // Copyright (C) MongoDB, Inc. 2017-present.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License"); you may
     4  // not use this file except in compliance with the License. You may obtain
     5  // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
     6  
     7  package description
     8  
     9  import (
    10  	"path"
    11  	"testing"
    12  
    13  	"go.mongodb.org/mongo-driver/internal/spectest"
    14  )
    15  
    16  const maxStalenessTestsDir = "../../testdata/max-staleness"
    17  
    18  // Test case for all max staleness spec tests.
    19  func TestMaxStalenessSpec(t *testing.T) {
    20  	for _, topology := range [...]string{
    21  		"ReplicaSetNoPrimary",
    22  		"ReplicaSetWithPrimary",
    23  		"Sharded",
    24  		"Single",
    25  		"Unknown",
    26  	} {
    27  		for _, file := range spectest.FindJSONFilesInDir(t,
    28  			path.Join(maxStalenessTestsDir, topology)) {
    29  
    30  			runTest(t, maxStalenessTestsDir, topology, file)
    31  		}
    32  	}
    33  }
    34  

View as plain text