@@ -54,6 +54,10 @@ const targetNamespace = "importer-namespace"
5454const credSuffixTest = "-credentials"
5555const activeStatus = "ACTIVE"
5656
57+ // These kinds represent global types in AKO which are independent of any Atlas Project.
58+ // They can be filtered in concurrent e2e tests if they are not relevant for assertion.
59+ var globalKinds = []string {"AtlasFederatedAuth" }
60+
5761var federationSettingsID string
5862var identityProviderStatus string
5963var samlIdentityProviderID string
@@ -209,13 +213,30 @@ func TestExportIndependentOrNot(t *testing.T) {
209213 require .NoError (t , err , string (resp ))
210214 var objects []runtime.Object
211215 objects , err = getK8SEntities (resp )
216+ // We want to filter spurious federated auth resources from other tests
217+ // as these are global resources across all projects.
218+ objects = filtered (objects ).byKind (globalKinds ... )
212219 require .NoError (t , err , "should not fail on decode but got:\n " + string (resp ))
213220 require .NotEmpty (t , objects )
214221 require .Equal (t , tc .expected , objects )
215222 })
216223 }
217224}
218225
226+ type filtered []runtime.Object
227+
228+ func (f filtered ) byKind (kinds ... string ) []runtime.Object {
229+ result := f [:0 ]
230+ for _ , obj := range f {
231+ for _ , kind := range kinds {
232+ if obj .GetObjectKind ().GroupVersionKind ().Kind != kind {
233+ result = append (result , obj )
234+ }
235+ }
236+ }
237+ return result
238+ }
239+
219240func defaultTestProject (name , namespace string , labels map [string ]string , alertConfigs bool ) * akov2.AtlasProject {
220241 project := & akov2.AtlasProject {
221242 TypeMeta : metav1.TypeMeta {
0 commit comments