forked from cilium/hubble-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e test case for partially dropped flows
- Loading branch information
1 parent
be86a68
commit 2f18e69
Showing
65 changed files
with
2,636 additions
and
6,967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,6 @@ yarn-error.log* | |
|
||
# VSCode | ||
.vscode | ||
|
||
# Cypress | ||
src/testing/e2e/cypress/screenshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package e2e | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/cilium/hubble-ui/backend/domain/events" | ||
"github.com/cilium/hubble-ui/backend/internal/events_log_file" | ||
"github.com/cilium/hubble-ui/backend/internal/mock/factories" | ||
"github.com/cilium/hubble-ui/backend/internal/mock/sources" | ||
ns_common "github.com/cilium/hubble-ui/backend/internal/ns_watcher/common" | ||
"github.com/cilium/hubble-ui/backend/pkg/rate_limiter" | ||
) | ||
|
||
func (tc *TestsController) enablePartiallyDroppedCase() error { | ||
flowsLogFile, err := tc.openLogFile("/flows/forwarded-and-dropped-2.json") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
nsSource := sources.Namespaces([]*ns_common.NSEvent{ | ||
factories.CreateNSEvent(events.Added, "default"), | ||
factories.CreateNSEvent(events.Added, "default"), | ||
}) | ||
|
||
flowsSource := sources.LogFile( | ||
flowsLogFile, | ||
tc.log.WithField("source", "FnD-flows"), | ||
sources.LogFileSourceOpts{ | ||
DebugHandler: func(i int, e *events_log_file.EventEntry) { | ||
if e == nil { | ||
return | ||
} | ||
|
||
tc.log. | ||
WithField("index", i). | ||
WithFields(e.LogEntries()). | ||
Debug("unparsed entry") | ||
}, | ||
}, | ||
) | ||
|
||
combined := sources.Combine(nsSource, flowsSource) | ||
tc.clients.SetSource(combined) | ||
|
||
flowsRateLimit := rate_limiter.RateLimit{ | ||
Limit: 100, | ||
Period: 5 * time.Second, | ||
} | ||
tc.clients.SetFlowsRateLimit(flowsRateLimit) | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { defineConfig } from 'cypress'; | ||
|
||
import webpackPreprocessor from '@cypress/webpack-preprocessor'; | ||
|
||
import mainWebpackConfig from './webpack.config'; | ||
|
||
export const webpackConfiguration = async (f: Cypress.FileObject) => { | ||
const opts = { webpackOptions: { ...mainWebpackConfig, plugins: [] } }; | ||
|
||
return await webpackPreprocessor(opts as any)(f); | ||
}; | ||
|
||
export default defineConfig({ | ||
projectId: '6to9oy', | ||
e2e: { | ||
specPattern: `src/testing/e2e/cypress/scenarios/**/*.cy.{js,jsx,ts,tsx}`, | ||
baseUrl: process.env.BASE_URL ?? 'http://127.0.0.1:8080', | ||
supportFile: 'src/testing/e2e/cypress/support/index.ts', | ||
chromeWebSecurity: false, | ||
env: { | ||
username: '[email protected]', | ||
password: 'password', | ||
}, | ||
setupNodeEvents: (on, _config) => { | ||
on('file:preprocessor', async f => await webpackConfiguration(f)); | ||
}, | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.