From 5cb182ef2e7127f1759124ed313d00ae8c51ad8f Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 17 Jan 2025 10:37:58 +0000 Subject: [PATCH 01/14] Remove BaseEventEmitter from worked The event that is emitted is never received anywhere else in the codebase. Simplify the exec and code by removing the BaseEventEmitter. --- js/modules/k6/browser/common/page.go | 5 +---- js/modules/k6/browser/common/worker.go | 15 ++++----------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/js/modules/k6/browser/common/page.go b/js/modules/k6/browser/common/page.go index 308d3015eb6..9306810d461 100644 --- a/js/modules/k6/browser/common/page.go +++ b/js/modules/k6/browser/common/page.go @@ -546,10 +546,7 @@ func (p *Page) consoleMsgFromConsoleEvent(e *runtime.EventConsoleAPICalled) (*Co func (p *Page) closeWorker(sessionID target.SessionID) { p.logger.Debugf("Page:closeWorker", "sid:%v", sessionID) - if worker, ok := p.workers[sessionID]; ok { - worker.didClose() - delete(p.workers, sessionID) - } + delete(p.workers, sessionID) } func (p *Page) defaultTimeout() time.Duration { diff --git a/js/modules/k6/browser/common/worker.go b/js/modules/k6/browser/common/worker.go index 85140c9b806..ca61fdf9e48 100644 --- a/js/modules/k6/browser/common/worker.go +++ b/js/modules/k6/browser/common/worker.go @@ -12,8 +12,6 @@ import ( ) type Worker struct { - BaseEventEmitter - ctx context.Context session session @@ -24,11 +22,10 @@ type Worker struct { // NewWorker creates a new page viewport. func NewWorker(ctx context.Context, s session, id target.ID, url string) (*Worker, error) { w := Worker{ - BaseEventEmitter: NewBaseEventEmitter(ctx), - ctx: ctx, - session: s, - targetID: id, - url: url, + ctx: ctx, + session: s, + targetID: id, + url: url, } if err := w.initEvents(); err != nil { return nil, err @@ -37,10 +34,6 @@ func NewWorker(ctx context.Context, s session, id target.ID, url string) (*Worke return &w, nil } -func (w *Worker) didClose() { - w.emit(EventWorkerClose, w) -} - func (w *Worker) initEvents() error { actions := []Action{ log.Enable(), From acd43f5647c891e6ffbf0a81bf29032d63e2aeb7 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 17 Jan 2025 10:39:33 +0000 Subject: [PATCH 02/14] Remove BaseEventEmitter from touchscreen The emitter is never used to emit anything. So remove it to simplify the codebase. --- js/modules/k6/browser/common/touchscreen.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/js/modules/k6/browser/common/touchscreen.go b/js/modules/k6/browser/common/touchscreen.go index d5daa4d5cb3..92f8b258a7f 100644 --- a/js/modules/k6/browser/common/touchscreen.go +++ b/js/modules/k6/browser/common/touchscreen.go @@ -10,8 +10,6 @@ import ( // Touchscreen represents a touchscreen. type Touchscreen struct { - BaseEventEmitter - ctx context.Context session session keyboard *Keyboard From 256a9dabc102b415f712892b792b1e34ade57efb Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 17 Jan 2025 10:41:41 +0000 Subject: [PATCH 03/14] Remove the event emit when session is closed Nothing is receiving the event when the session is closed. --- js/modules/k6/browser/common/session.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/js/modules/k6/browser/common/session.go b/js/modules/k6/browser/common/session.go index 2d544b5d3c1..d1b46cf86e0 100644 --- a/js/modules/k6/browser/common/session.go +++ b/js/modules/k6/browser/common/session.go @@ -68,8 +68,6 @@ func (s *Session) close() { // Stop the read loop close(s.done) s.closed = true - - s.emit(EventSessionClosed, nil) } func (s *Session) markAsCrashed() { From 1318b5e522088535a4cef980cf30dd7db443fd6b Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 17 Jan 2025 10:43:27 +0000 Subject: [PATCH 04/14] Remove BaseEventEmitter from page The events which are emitted with the page's event emitter instance weren't being received by anything else in the codebase. --- js/modules/k6/browser/common/frame.go | 1 - js/modules/k6/browser/common/frame_manager.go | 11 ----------- js/modules/k6/browser/common/frame_session.go | 3 +-- js/modules/k6/browser/common/page.go | 11 ----------- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/js/modules/k6/browser/common/frame.go b/js/modules/k6/browser/common/frame.go index b84a3454a14..2f54b90f702 100644 --- a/js/modules/k6/browser/common/frame.go +++ b/js/modules/k6/browser/common/frame.go @@ -314,7 +314,6 @@ func (f *Frame) navigated(name string, url string, loaderID string) { f.name = name f.url = url f.loaderID = loaderID - f.page.emit(EventPageFrameNavigated, f) } func (f *Frame) nullContext(execCtxID runtime.ExecutionContextID) { diff --git a/js/modules/k6/browser/common/frame_manager.go b/js/modules/k6/browser/common/frame_manager.go index e605aa5eae3..20c4d7d1539 100644 --- a/js/modules/k6/browser/common/frame_manager.go +++ b/js/modules/k6/browser/common/frame_manager.go @@ -157,8 +157,6 @@ func (m *FrameManager) frameAttached(frameID cdp.FrameID, parentFrameID cdp.Fram m.logger.Debugf("FrameManager:frameAttached:emit:EventPageFrameAttached", "fmid:%d fid:%v pfid:%v", m.ID(), frameID, parentFrameID) - - m.page.emit(EventPageFrameAttached, frame) } } @@ -476,8 +474,6 @@ func (m *FrameManager) removeFramesRecursively(frame *Frame) error { m.logger.Debugf("FrameManager:removeFramesRecursively:emit:EventPageFrameDetached", "fmid:%d fid:%v fname:%s furl:%s", m.ID(), frame.ID(), frame.Name(), frame.URL()) - - m.page.emit(EventPageFrameDetached, frame) } return nil @@ -486,8 +482,6 @@ func (m *FrameManager) removeFramesRecursively(frame *Frame) error { func (m *FrameManager) requestFailed(req *Request, canceled bool) { m.logger.Debugf("FrameManager:requestFailed", "fmid:%d rurl:%s", m.ID(), req.URL()) - defer m.page.emit(EventPageRequestFailed, req) - frame := req.getFrame() if frame == nil { m.logger.Debugf("FrameManager:requestFailed", "frame is nil") @@ -517,8 +511,6 @@ func (m *FrameManager) requestFinished(req *Request) { m.logger.Debugf("FrameManager:requestFinished", "fmid:%d rurl:%s", m.ID(), req.URL()) - defer m.page.emit(EventPageRequestFinished, req) - frame := req.getFrame() if frame == nil { m.logger.Debugf("FrameManager:requestFinished:return", @@ -537,8 +529,6 @@ func (m *FrameManager) requestFinished(req *Request) { func (m *FrameManager) requestReceivedResponse(res *Response) { m.logger.Debugf("FrameManager:requestReceivedResponse", "fmid:%d rurl:%s", m.ID(), res.URL()) - - m.page.emit(EventPageResponse, res) } func (m *FrameManager) requestStarted(req *Request) { @@ -546,7 +536,6 @@ func (m *FrameManager) requestStarted(req *Request) { m.framesMu.Lock() defer m.framesMu.Unlock() - defer m.page.emit(EventPageRequest, req) frame := req.getFrame() if frame == nil { diff --git a/js/modules/k6/browser/common/frame_session.go b/js/modules/k6/browser/common/frame_session.go index 9a15af6068a..b212bbca75c 100644 --- a/js/modules/k6/browser/common/frame_session.go +++ b/js/modules/k6/browser/common/frame_session.go @@ -661,7 +661,7 @@ func (fs *FrameSession) onConsoleAPICalled(event *cdpruntime.EventConsoleAPICall } func (fs *FrameSession) onExceptionThrown(event *cdpruntime.EventExceptionThrown) { - fs.page.emit(EventPageError, event.ExceptionDetails) + // TODO: Test and handle this } func (fs *FrameSession) onExecutionContextCreated(event *cdpruntime.EventExecutionContextCreated) { @@ -1061,7 +1061,6 @@ func (fs *FrameSession) onTargetCrashed() { k6ext.Panic(fs.ctx, "unexpected type %T", fs.session) } s.markAsCrashed() - fs.page.didCrash() } func (fs *FrameSession) updateEmulateMedia() error { diff --git a/js/modules/k6/browser/common/page.go b/js/modules/k6/browser/common/page.go index 9306810d461..1c86dd492f7 100644 --- a/js/modules/k6/browser/common/page.go +++ b/js/modules/k6/browser/common/page.go @@ -186,8 +186,6 @@ type PageOnHandler func(PageOnEvent) error // Page stores Page/tab related context. type Page struct { - BaseEventEmitter - Keyboard *Keyboard Mouse *Mouse Touchscreen *Touchscreen @@ -246,7 +244,6 @@ func NewPage( logger *log.Logger, ) (*Page, error) { p := Page{ - BaseEventEmitter: NewBaseEventEmitter(ctx), ctx: ctx, session: s, browserCtx: bctx, @@ -561,14 +558,6 @@ func (p *Page) didClose() { p.closed = true } p.closedMu.Unlock() - - p.emit(EventPageClose, p) -} - -func (p *Page) didCrash() { - p.logger.Debugf("Page:didCrash", "sid:%v", p.sessionID()) - - p.emit(EventPageCrash, p) } func (p *Page) evaluateOnNewDocument(source string) error { From 62fd2096549c245b288fdcaf755bf638c47bdbca Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 17 Jan 2025 10:44:47 +0000 Subject: [PATCH 05/14] Remove the events which aren't being used --- js/modules/k6/browser/common/event_emitter.go | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/js/modules/k6/browser/common/event_emitter.go b/js/modules/k6/browser/common/event_emitter.go index 62b13332603..627baecb45a 100644 --- a/js/modules/k6/browser/common/event_emitter.go +++ b/js/modules/k6/browser/common/event_emitter.go @@ -22,34 +22,6 @@ const ( EventFrameNavigation string = "navigation" EventFrameAddLifecycle string = "addlifecycle" - - // Page - - EventPageClose string = "close" - EventPageConsole string = "console" - EventPageCrash string = "crash" - EventPageDialog string = "dialog" - EventPageDownload string = "download" - EventPageFilechooser string = "filechooser" - EventPageFrameAttached string = "frameattached" - EventPageFrameDetached string = "framedetached" - EventPageFrameNavigated string = "framenavigated" - EventPageError string = "pageerror" - EventPagePopup string = "popup" - EventPageRequest string = "request" - EventPageRequestFailed string = "requestfailed" - EventPageRequestFinished string = "requestfinished" - EventPageResponse string = "response" - EventPageWebSocket string = "websocket" - EventPageWorker string = "worker" - - // Session - - EventSessionClosed string = "close" - - // Worker - - EventWorkerClose string = "close" ) // Event as emitted by an EventEmiter. From cd16864c9f7c60cdc73a08d3e3a57e875e79ed6a Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 20 Jan 2025 11:10:46 +0000 Subject: [PATCH 06/14] Remove method that isn't needed --- js/modules/k6/browser/common/frame_manager.go | 4 ---- js/modules/k6/browser/common/network_manager.go | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/js/modules/k6/browser/common/frame_manager.go b/js/modules/k6/browser/common/frame_manager.go index 20c4d7d1539..44113bc9e9c 100644 --- a/js/modules/k6/browser/common/frame_manager.go +++ b/js/modules/k6/browser/common/frame_manager.go @@ -527,10 +527,6 @@ func (m *FrameManager) requestFinished(req *Request) { */ } -func (m *FrameManager) requestReceivedResponse(res *Response) { - m.logger.Debugf("FrameManager:requestReceivedResponse", "fmid:%d rurl:%s", m.ID(), res.URL()) -} - func (m *FrameManager) requestStarted(req *Request) { m.logger.Debugf("FrameManager:requestStarted", "fmid:%d rurl:%s", m.ID(), req.URL()) diff --git a/js/modules/k6/browser/common/network_manager.go b/js/modules/k6/browser/common/network_manager.go index 266e380b5af..f44ae856d2f 100644 --- a/js/modules/k6/browser/common/network_manager.go +++ b/js/modules/k6/browser/common/network_manager.go @@ -660,7 +660,8 @@ func (m *NetworkManager) onResponseReceived(event *network.EventResponseReceived req.responseMu.Lock() req.response = resp req.responseMu.Unlock() - m.frameManager.requestReceivedResponse(resp) + + m.logger.Debugf("FrameManager:onResponseReceived", "rid:%s rurl:%s", event.RequestID, resp.URL()) } func (m *NetworkManager) requestFromID(reqID network.RequestID) (*Request, bool) { From c1260281302df91f8ef7a60bc3734003bea2eb5c Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 20 Jan 2025 11:12:27 +0000 Subject: [PATCH 07/14] Remove unneeded logging --- js/modules/k6/browser/common/frame_manager.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/js/modules/k6/browser/common/frame_manager.go b/js/modules/k6/browser/common/frame_manager.go index 44113bc9e9c..ac4b052ae2d 100644 --- a/js/modules/k6/browser/common/frame_manager.go +++ b/js/modules/k6/browser/common/frame_manager.go @@ -470,12 +470,6 @@ func (m *FrameManager) removeFramesRecursively(frame *Frame) error { delete(m.frames, cdp.FrameID(frame.ID())) m.framesMu.Unlock() - if !m.page.IsClosed() { - m.logger.Debugf("FrameManager:removeFramesRecursively:emit:EventPageFrameDetached", - "fmid:%d fid:%v fname:%s furl:%s", - m.ID(), frame.ID(), frame.Name(), frame.URL()) - } - return nil } From 9ed3b3880109df11ea6412c21720a26be5277fe6 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 20 Jan 2025 11:16:00 +0000 Subject: [PATCH 08/14] Rename method to removeWorker --- js/modules/k6/browser/common/frame_session.go | 2 +- js/modules/k6/browser/common/page.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/modules/k6/browser/common/frame_session.go b/js/modules/k6/browser/common/frame_session.go index b212bbca75c..392d63d8a45 100644 --- a/js/modules/k6/browser/common/frame_session.go +++ b/js/modules/k6/browser/common/frame_session.go @@ -1049,7 +1049,7 @@ func (fs *FrameSession) onDetachedFromTarget(event *target.EventDetachedFromTarg "sid:%v tid:%v esid:%v", fs.session.ID(), fs.targetID, event.SessionID) - fs.page.closeWorker(event.SessionID) + fs.page.removeWorker(event.SessionID) } func (fs *FrameSession) onTargetCrashed() { diff --git a/js/modules/k6/browser/common/page.go b/js/modules/k6/browser/common/page.go index 1c86dd492f7..119b57799ae 100644 --- a/js/modules/k6/browser/common/page.go +++ b/js/modules/k6/browser/common/page.go @@ -540,8 +540,8 @@ func (p *Page) consoleMsgFromConsoleEvent(e *runtime.EventConsoleAPICalled) (*Co }, nil } -func (p *Page) closeWorker(sessionID target.SessionID) { - p.logger.Debugf("Page:closeWorker", "sid:%v", sessionID) +func (p *Page) removeWorker(sessionID target.SessionID) { + p.logger.Debugf("Page:removeWorker", "sid:%v", sessionID) delete(p.workers, sessionID) } From a9854f18d5db8db8bc0c6ec69b8fe61a164ae320 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 20 Jan 2025 16:14:46 +0000 Subject: [PATCH 09/14] Add debug logs in onExceptionThrown --- js/modules/k6/browser/common/frame_session.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/modules/k6/browser/common/frame_session.go b/js/modules/k6/browser/common/frame_session.go index 392d63d8a45..eba9dfcf88c 100644 --- a/js/modules/k6/browser/common/frame_session.go +++ b/js/modules/k6/browser/common/frame_session.go @@ -660,8 +660,14 @@ func (fs *FrameSession) onConsoleAPICalled(event *cdpruntime.EventConsoleAPICall l.Debug(msg) } +// We should consider building an API around this as it could be useful +// information about the user's website not handling exceptions. func (fs *FrameSession) onExceptionThrown(event *cdpruntime.EventExceptionThrown) { - // TODO: Test and handle this + fs.logger.Debugf("FrameSession:onExceptionThrown", + "sid:%v tid:%v url:%s line:%d col:%d text:%s", + fs.session.ID(), fs.targetID, event.ExceptionDetails.URL, + event.ExceptionDetails.LineNumber, event.ExceptionDetails.ColumnNumber, + event.ExceptionDetails.Text) } func (fs *FrameSession) onExecutionContextCreated(event *cdpruntime.EventExecutionContextCreated) { From 6c4752c0722b02cd2b0551ffd3c02da9aa6ce20f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Lopes?= Date: Wed, 22 Jan 2025 12:21:52 +0100 Subject: [PATCH 10/14] Refactor `new` command (#4153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refactor new command and templates Signed-off-by: Daniel González Lopes * Move Cloud to another command Signed-off-by: Daniel González Lopes * Fix tests Signed-off-by: Daniel González Lopes * Small changes to the templates Signed-off-by: Daniel González Lopes * Move everything to one command based on feedback Signed-off-by: Daniel González Lopes * Fix help text Signed-off-by: Daniel González Lopes * Simplify cloud logic Signed-off-by: Daniel González Lopes * Make linter happy Signed-off-by: Daniel González Lopes * Fix package name and description Signed-off-by: Daniel González Lopes * Use Authorization header instead of User-ID Signed-off-by: Daniel González Lopes * Remove extra vus Signed-off-by: Daniel González Lopes * Improve example text based on feedback Signed-off-by: Daniel González Lopes * Add new lines in the browser template based on feedback Signed-off-by: Daniel González Lopes * Add vus/iterations to the Browser example Signed-off-by: Daniel González Lopes * Add catch + fail in the Browser template Signed-off-by: Daniel González Lopes * Rename templates folder Signed-off-by: Daniel González Lopes * Fix copy of force command Signed-off-by: Daniel González Lopes * Remove the panic Signed-off-by: Daniel González Lopes * Add constants for template types Signed-off-by: Daniel González Lopes * Use exec.test.abort instead of throw Signed-off-by: Daniel González Lopes * Make linter happy Signed-off-by: Daniel González Lopes * Add package comment to templates.go --------- Signed-off-by: Daniel González Lopes --- cmd/new.go | 158 +++++++++++++------------------------ cmd/new_test.go | 28 ++++++- cmd/templates/browser.js | 63 +++++++++++++++ cmd/templates/minimal.js | 17 ++++ cmd/templates/protocol.js | 50 ++++++++++++ cmd/templates/templates.go | 81 +++++++++++++++++++ 6 files changed, 294 insertions(+), 103 deletions(-) create mode 100644 cmd/templates/browser.js create mode 100644 cmd/templates/minimal.js create mode 100644 cmd/templates/protocol.js create mode 100644 cmd/templates/templates.go diff --git a/cmd/new.go b/cmd/new.go index 39a1720efbe..b0932481832 100644 --- a/cmd/new.go +++ b/cmd/new.go @@ -2,99 +2,33 @@ package cmd import ( "fmt" - "path" - "text/template" - "github.com/fatih/color" "github.com/spf13/cobra" "github.com/spf13/pflag" "go.k6.io/k6/cmd/state" + "go.k6.io/k6/cmd/templates" "go.k6.io/k6/lib/fsext" ) const defaultNewScriptName = "script.js" -//nolint:gochecknoglobals -var defaultNewScriptTemplate = template.Must(template.New("new").Parse(`import http from 'k6/http'; -import { sleep } from 'k6'; - -export const options = { - // A number specifying the number of VUs to run concurrently. - vus: 10, - // A string specifying the total duration of the test run. - duration: '30s', - - // The following section contains configuration options for execution of this - // test script in Grafana Cloud. - // - // See https://grafana.com/docs/grafana-cloud/k6/get-started/run-cloud-tests-from-the-cli/ - // to learn about authoring and running k6 test scripts in Grafana k6 Cloud. - // - // cloud: { - // // The ID of the project to which the test is assigned in the k6 Cloud UI. - // // By default tests are executed in default project. - // projectID: "", - // // The name of the test in the k6 Cloud UI. - // // Test runs with the same name will be grouped. - // name: "{{ .ScriptName }}" - // }, - - // Uncomment this section to enable the use of Browser API in your tests. - // - // See https://grafana.com/docs/k6/latest/using-k6-browser/running-browser-tests/ to learn more - // about using Browser API in your test scripts. - // - // scenarios: { - // // The scenario name appears in the result summary, tags, and so on. - // // You can give the scenario any name, as long as each name in the script is unique. - // ui: { - // // Executor is a mandatory parameter for browser-based tests. - // // Shared iterations in this case tells k6 to reuse VUs to execute iterations. - // // - // // See https://grafana.com/docs/k6/latest/using-k6/scenarios/executors/ for other executor types. - // executor: 'shared-iterations', - // options: { - // browser: { - // // This is a mandatory parameter that instructs k6 to launch and - // // connect to a chromium-based browser, and use it to run UI-based - // // tests. - // type: 'chromium', - // }, - // }, - // }, - // } -}; - -// The function that defines VU logic. -// -// See https://grafana.com/docs/k6/latest/examples/get-started-with-k6/ to learn more -// about authoring k6 scripts. -// -export default function() { - http.get('https://test.k6.io'); - sleep(1); -} -`)) - -type initScriptTemplateArgs struct { - ScriptName string -} - -// newScriptCmd represents the `k6 new` command type newScriptCmd struct { gs *state.GlobalState overwriteFiles bool + templateType string + projectID string } func (c *newScriptCmd) flagSet() *pflag.FlagSet { flags := pflag.NewFlagSet("", pflag.ContinueOnError) flags.SortFlags = false - flags.BoolVarP(&c.overwriteFiles, "force", "f", false, "Overwrite existing files") - + flags.BoolVarP(&c.overwriteFiles, "force", "f", false, "overwrite existing files") + flags.StringVar(&c.templateType, "template", "minimal", "template type (choices: minimal, protocol, browser)") + flags.StringVar(&c.projectID, "project-id", "", "specify the Grafana Cloud project ID for the test") return flags } -func (c *newScriptCmd) run(cmd *cobra.Command, args []string) error { //nolint:revive +func (c *newScriptCmd) run(_ *cobra.Command, args []string) error { target := defaultNewScriptName if len(args) > 0 { target = args[0] @@ -104,32 +38,52 @@ func (c *newScriptCmd) run(cmd *cobra.Command, args []string) error { //nolint:r if err != nil { return err } - if fileExists && !c.overwriteFiles { - return fmt.Errorf("%s already exists, please use the `--force` flag if you want overwrite it", target) + return fmt.Errorf("%s already exists. Use the `--force` flag to overwrite it", target) } fd, err := c.gs.FS.Create(target) if err != nil { return err } + + var closeErr error defer func() { - _ = fd.Close() // we may think to check the error and log + if cerr := fd.Close(); cerr != nil { + if _, err := fmt.Fprintf(c.gs.Stderr, "error closing file: %v\n", cerr); err != nil { + closeErr = fmt.Errorf("error writing error message to stderr: %w", err) + } else { + closeErr = cerr + } + } }() - if err := defaultNewScriptTemplate.Execute(fd, initScriptTemplateArgs{ - ScriptName: path.Base(target), - }); err != nil { + if closeErr != nil { + return closeErr + } + + tm, err := templates.NewTemplateManager() + if err != nil { + return fmt.Errorf("error initializing template manager: %w", err) + } + + tmpl, err := tm.GetTemplate(c.templateType) + if err != nil { + return fmt.Errorf("error retrieving template: %w", err) + } + + argsStruct := templates.TemplateArgs{ + ScriptName: target, + ProjectID: c.projectID, + } + + if err := templates.ExecuteTemplate(fd, tmpl, argsStruct); err != nil { return err } - valueColor := getColor(c.gs.Flags.NoColor || !c.gs.Stdout.IsTTY, color.Bold) - printToStdout(c.gs, fmt.Sprintf( - "Initialized a new k6 test script in %s. You can now execute it by running `%s run %s`.\n", - valueColor.Sprint(target), - c.gs.BinaryName, - target, - )) + if _, err := fmt.Fprintf(c.gs.Stdout, "New script created: %s (%s template).\n", target, c.templateType); err != nil { + return err + } return nil } @@ -137,31 +91,33 @@ func (c *newScriptCmd) run(cmd *cobra.Command, args []string) error { //nolint:r func getCmdNewScript(gs *state.GlobalState) *cobra.Command { c := &newScriptCmd{gs: gs} - exampleText := getExampleText(gs, ` - # Create a minimal k6 script in the current directory. By default, k6 creates script.js. - {{.}} new + exampleText := getExampleText(c.gs, ` + # Create a new k6 script with the default template + $ {{.}} new + + # Specify a file name when creating a script + $ {{.}} new test.js + + # Overwrite an existing file + $ {{.}} new -f test.js - # Create a minimal k6 script in the current directory and store it in test.js - {{.}} new test.js + # Create a script using a specific template + $ {{.}} new --template protocol - # Overwrite existing test.js with a minimal k6 script - {{.}} new -f test.js`[1:]) + # Create a cloud-ready script with a specific project ID + $ {{.}} new --project-id 12315`[1:]) initCmd := &cobra.Command{ - Use: "new", + Use: "new [file]", Short: "Create and initialize a new k6 script", - Long: `Create and initialize a new k6 script. + Long: `Create and initialize a new k6 script using one of the predefined templates. -This command will create a minimal k6 script in the current directory and -store it in the file specified by the first argument. If no argument is -provided, the script will be stored in script.js. - -This command will not overwrite existing files.`, +By default, the script will be named script.js unless a different name is specified.`, Example: exampleText, Args: cobra.MaximumNArgs(1), RunE: c.run, } - initCmd.Flags().AddFlagSet(c.flagSet()) + initCmd.Flags().AddFlagSet(c.flagSet()) return initCmd } diff --git a/cmd/new_test.go b/cmd/new_test.go index 1b97cf38718..f451889feda 100644 --- a/cmd/new_test.go +++ b/cmd/new_test.go @@ -1,7 +1,6 @@ package cmd import ( - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -56,7 +55,6 @@ func TestNewScriptCmd(t *testing.T) { jsData := string(data) assert.Contains(t, jsData, "export const options = {") - assert.Contains(t, jsData, fmt.Sprintf(`name: "%s"`, testCase.expectedCloudName)) assert.Contains(t, jsData, "export default function() {") }) } @@ -95,3 +93,29 @@ func TestNewScriptCmd_FileExists_Overwrite(t *testing.T) { assert.Contains(t, string(data), "export const options = {") assert.Contains(t, string(data), "export default function() {") } + +func TestNewScriptCmd_InvalidTemplateType(t *testing.T) { + t.Parallel() + + ts := tests.NewGlobalTestState(t) + ts.CmdArgs = []string{"k6", "new", "--template", "invalid-template"} + + ts.ExpectedExitCode = -1 + + newRootCommand(ts.GlobalState).execute() + assert.Contains(t, ts.Stderr.String(), "invalid template type") +} + +func TestNewScriptCmd_ProjectID(t *testing.T) { + t.Parallel() + + ts := tests.NewGlobalTestState(t) + ts.CmdArgs = []string{"k6", "new", "--project-id", "1422"} + + newRootCommand(ts.GlobalState).execute() + + data, err := fsext.ReadFile(ts.FS, defaultNewScriptName) + require.NoError(t, err) + + assert.Contains(t, string(data), "projectID: 1422") +} diff --git a/cmd/templates/browser.js b/cmd/templates/browser.js new file mode 100644 index 00000000000..2fbd01c426d --- /dev/null +++ b/cmd/templates/browser.js @@ -0,0 +1,63 @@ +import http from "k6/http"; +import exec from 'k6/execution'; +import { browser } from "k6/browser"; +import { sleep, check, fail } from 'k6'; + +const BASE_URL = __ENV.BASE_URL || "https://quickpizza.grafana.com"; + +export const options = { + scenarios: { + ui: { + executor: "shared-iterations", + vus: 1, + iterations: 1, + options: { + browser: { + type: "chromium", + }, + }, + }, + },{{ if .ProjectID }} + cloud: { + projectID: {{ .ProjectID }}, + name: "{{ .ScriptName }}", + },{{ end }} +}; + +export function setup() { + let res = http.get(BASE_URL); + if (res.status !== 200) { + exec.test.abort(`Got unexpected status code ${res.status} when trying to setup. Exiting.`); + } +} + +export default async function() { + let checkData; + const page = await browser.newPage(); + + try { + await page.goto(BASE_URL); + + checkData = await page.locator("h1").textContent(); + check(page, { + header: checkData === "Looking to break out of your pizza routine?", + }); + + await page.locator('//button[. = "Pizza, Please!"]').click(); + await page.waitForTimeout(500); + + await page.screenshot({ path: "screenshot.png" }); + + checkData = await page.locator("div#recommendations").textContent(); + check(page, { + recommendation: checkData !== "", + }); + } catch (error) { + fail(`Browser iteration failed: ${error.message}`); + } finally { + await page.close(); + } + + sleep(1); +} + diff --git a/cmd/templates/minimal.js b/cmd/templates/minimal.js new file mode 100644 index 00000000000..716c08802ea --- /dev/null +++ b/cmd/templates/minimal.js @@ -0,0 +1,17 @@ +import http from 'k6/http'; +import { sleep, check } from 'k6'; + +export const options = { + vus: 10, + duration: '30s',{{ if .ProjectID }} + cloud: { + projectID: {{ .ProjectID }}, + name: "{{ .ScriptName }}", + },{{ end }} +}; + +export default function() { + let res = http.get('https://quickpizza.grafana.com'); + check(res, { "status is 200": (res) => res.status === 200 }); + sleep(1); +} diff --git a/cmd/templates/protocol.js b/cmd/templates/protocol.js new file mode 100644 index 00000000000..f00bdc8298e --- /dev/null +++ b/cmd/templates/protocol.js @@ -0,0 +1,50 @@ +import http from "k6/http"; +import exec from 'k6/execution'; +import { check, sleep } from "k6"; + +const BASE_URL = __ENV.BASE_URL || 'https://quickpizza.grafana.com'; + +export const options = { + stages: [ + { duration: "10s", target: 5 }, + { duration: "20s", target: 10 }, + { duration: "1s", target: 0 }, + ], + thresholds: { + http_req_failed: ["rate<0.01"], + http_req_duration: ["p(95)<500", "p(99)<1000"], + },{{ if .ProjectID }} + cloud: { + projectID: {{ .ProjectID }}, + name: "{{ .ScriptName }}", + },{{ end }} +}; + +export function setup() { + let res = http.get(BASE_URL); + if (res.status !== 200) { + exec.test.abort(`Got unexpected status code ${res.status} when trying to setup. Exiting.`); + } +} + +export default function() { + let restrictions = { + maxCaloriesPerSlice: 500, + mustBeVegetarian: false, + excludedIngredients: ["pepperoni"], + excludedTools: ["knife"], + maxNumberOfToppings: 6, + minNumberOfToppings: 2 + }; + + let res = http.post(BASE_URL + "/api/pizza", JSON.stringify(restrictions), { + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'token abcdef0123456789', + }, + }); + + check(res, { "status is 200": (res) => res.status === 200 }); + console.log(res.json().pizza.name + " (" + res.json().pizza.ingredients.length + " ingredients)"); + sleep(1); +} diff --git a/cmd/templates/templates.go b/cmd/templates/templates.go new file mode 100644 index 00000000000..55fc22b54ce --- /dev/null +++ b/cmd/templates/templates.go @@ -0,0 +1,81 @@ +// Package templates provides the templates used by the `k6 new` command +package templates + +import ( + _ "embed" + "fmt" + "io" + "text/template" +) + +//go:embed minimal.js +var minimalTemplateContent string + +//go:embed protocol.js +var protocolTemplateContent string + +//go:embed browser.js +var browserTemplateContent string + +// Constants for template types +const ( + MinimalTemplate = "minimal" + ProtocolTemplate = "protocol" + BrowserTemplate = "browser" +) + +// TemplateManager manages the pre-parsed templates +type TemplateManager struct { + minimalTemplate *template.Template + protocolTemplate *template.Template + browserTemplate *template.Template +} + +// NewTemplateManager initializes a new TemplateManager with parsed templates +func NewTemplateManager() (*TemplateManager, error) { + minimalTmpl, err := template.New(MinimalTemplate).Parse(minimalTemplateContent) + if err != nil { + return nil, fmt.Errorf("failed to parse minimal template: %w", err) + } + + protocolTmpl, err := template.New(ProtocolTemplate).Parse(protocolTemplateContent) + if err != nil { + return nil, fmt.Errorf("failed to parse protocol template: %w", err) + } + + browserTmpl, err := template.New(BrowserTemplate).Parse(browserTemplateContent) + if err != nil { + return nil, fmt.Errorf("failed to parse browser template: %w", err) + } + + return &TemplateManager{ + minimalTemplate: minimalTmpl, + protocolTemplate: protocolTmpl, + browserTemplate: browserTmpl, + }, nil +} + +// GetTemplate selects the appropriate template based on the type +func (tm *TemplateManager) GetTemplate(templateType string) (*template.Template, error) { + switch templateType { + case MinimalTemplate: + return tm.minimalTemplate, nil + case ProtocolTemplate: + return tm.protocolTemplate, nil + case BrowserTemplate: + return tm.browserTemplate, nil + default: + return nil, fmt.Errorf("invalid template type: %s", templateType) + } +} + +// TemplateArgs represents arguments passed to templates +type TemplateArgs struct { + ScriptName string + ProjectID string +} + +// ExecuteTemplate applies the template with provided arguments and writes to the provided writer +func ExecuteTemplate(w io.Writer, tmpl *template.Template, args TemplateArgs) error { + return tmpl.Execute(w, args) +} From 5acc22216cc0e90faa43222151d5c1d64475d3b8 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Wed, 22 Jan 2025 16:16:45 +0200 Subject: [PATCH 11/14] Run dependabot weekly --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 899ac7666c0..9a981a1f136 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,7 +3,7 @@ updates: - package-ecosystem: "gomod" directory: "/" schedule: - interval: "daily" + interval: "weekly" open-pull-requests-limit: 50 groups: golangx: From e6fc9127da7bf49ee13363c1f5501b4180506bed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:26:32 +0000 Subject: [PATCH 12/14] Bump google.golang.org/protobuf in the googles group across 1 directory Bumps the googles group with 1 update in the / directory: google.golang.org/protobuf. Updates `google.golang.org/protobuf` from 1.36.2 to 1.36.3 --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-patch dependency-group: googles ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- .../protobuf/encoding/protojson/decode.go | 2 +- .../protobuf/encoding/prototext/decode.go | 2 +- .../protobuf/internal/flags/flags.go | 5 ++ .../protobuf/internal/impl/codec_map.go | 14 ++--- .../protobuf/internal/impl/codec_map_go111.go | 38 ------------- .../protobuf/internal/impl/codec_map_go112.go | 12 ---- .../protobuf/internal/impl/codec_message.go | 4 +- .../internal/impl/codec_message_opaque.go | 6 +- .../protobuf/internal/impl/convert_map.go | 2 +- .../protobuf/internal/impl/message.go | 12 ++-- .../protobuf/internal/impl/message_opaque.go | 12 ++-- .../internal/impl/message_reflect_field.go | 56 +++---------------- .../protobuf/internal/impl/pointer_unsafe.go | 2 +- .../protobuf/internal/version/version.go | 2 +- .../protobuf/proto/decode.go | 2 +- .../reflect/protodesc/desc_validate.go | 2 +- .../protobuf/reflect/protodesc/editions.go | 31 ++++++---- .../protobuf/types/dynamicpb/types.go | 12 ++-- vendor/modules.txt | 2 +- 21 files changed, 74 insertions(+), 150 deletions(-) delete mode 100644 vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go delete mode 100644 vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go diff --git a/go.mod b/go.mod index 96d1bdabd0c..50056066644 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( golang.org/x/term v0.28.0 golang.org/x/time v0.9.0 google.golang.org/grpc v1.69.4 - google.golang.org/protobuf v1.36.2 + google.golang.org/protobuf v1.36.3 gopkg.in/guregu/null.v3 v3.3.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 69c372dfd65..187a3278862 100644 --- a/go.sum +++ b/go.sum @@ -333,8 +333,8 @@ google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A= google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= -google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU= +google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y= gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go index 8f9e592f870..cffdfda9619 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go @@ -192,7 +192,7 @@ func (d decoder) unmarshalMessage(m protoreflect.Message, skipTypeURL bool) erro fd = fieldDescs.ByTextName(name) } } - if flags.ProtoLegacy { + if flags.ProtoLegacyWeak { if fd != nil && fd.IsWeak() && fd.Message().IsPlaceholder() { fd = nil // reset since the weak reference is not linked in } diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go index 24bc98ac422..d972a3d98ed 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go @@ -185,7 +185,7 @@ func (d decoder) unmarshalMessage(m protoreflect.Message, checkDelims bool) erro } else if xtErr != nil && xtErr != protoregistry.NotFound { return d.newError(tok.Pos(), "unable to resolve [%s]: %v", tok.RawString(), xtErr) } - if flags.ProtoLegacy { + if flags.ProtoLegacyWeak { if fd != nil && fd.IsWeak() && fd.Message().IsPlaceholder() { fd = nil // reset since the weak reference is not linked in } diff --git a/vendor/google.golang.org/protobuf/internal/flags/flags.go b/vendor/google.golang.org/protobuf/internal/flags/flags.go index 58372dd3485..5cb3ee70f91 100644 --- a/vendor/google.golang.org/protobuf/internal/flags/flags.go +++ b/vendor/google.golang.org/protobuf/internal/flags/flags.go @@ -22,3 +22,8 @@ const ProtoLegacy = protoLegacy // extension fields at unmarshal time, but defers creating the message // structure until the extension is first accessed. const LazyUnmarshalExtensions = ProtoLegacy + +// ProtoLegacyWeak specifies whether to enable support for weak fields. +// This flag was split out of ProtoLegacy in preparation for removing +// support for weak fields (independent of the other protolegacy features). +const ProtoLegacyWeak = ProtoLegacy diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go index fb35f0bae9c..229c6980138 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go @@ -94,7 +94,7 @@ func sizeMap(mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo, opts marshalO return 0 } n := 0 - iter := mapRange(mapv) + iter := mapv.MapRange() for iter.Next() { key := mapi.conv.keyConv.PBValueOf(iter.Key()).MapKey() keySize := mapi.keyFuncs.size(key.Value(), mapKeyTagSize, opts) @@ -281,7 +281,7 @@ func appendMap(b []byte, mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo, o if opts.Deterministic() { return appendMapDeterministic(b, mapv, mapi, f, opts) } - iter := mapRange(mapv) + iter := mapv.MapRange() for iter.Next() { var err error b = protowire.AppendVarint(b, f.wiretag) @@ -328,7 +328,7 @@ func isInitMap(mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo) error { if !mi.needsInitCheck { return nil } - iter := mapRange(mapv) + iter := mapv.MapRange() for iter.Next() { val := pointerOfValue(iter.Value()) if err := mi.checkInitializedPointer(val); err != nil { @@ -336,7 +336,7 @@ func isInitMap(mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo) error { } } } else { - iter := mapRange(mapv) + iter := mapv.MapRange() for iter.Next() { val := mapi.conv.valConv.PBValueOf(iter.Value()) if err := mapi.valFuncs.isInit(val); err != nil { @@ -356,7 +356,7 @@ func mergeMap(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { if dstm.IsNil() { dstm.Set(reflect.MakeMap(f.ft)) } - iter := mapRange(srcm) + iter := srcm.MapRange() for iter.Next() { dstm.SetMapIndex(iter.Key(), iter.Value()) } @@ -371,7 +371,7 @@ func mergeMapOfBytes(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { if dstm.IsNil() { dstm.Set(reflect.MakeMap(f.ft)) } - iter := mapRange(srcm) + iter := srcm.MapRange() for iter.Next() { dstm.SetMapIndex(iter.Key(), reflect.ValueOf(append(emptyBuf[:], iter.Value().Bytes()...))) } @@ -386,7 +386,7 @@ func mergeMapOfMessage(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { if dstm.IsNil() { dstm.Set(reflect.MakeMap(f.ft)) } - iter := mapRange(srcm) + iter := srcm.MapRange() for iter.Next() { val := reflect.New(f.ft.Elem().Elem()) if f.mi != nil { diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go b/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go deleted file mode 100644 index 4b15493f2f4..00000000000 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.12 -// +build !go1.12 - -package impl - -import "reflect" - -type mapIter struct { - v reflect.Value - keys []reflect.Value -} - -// mapRange provides a less-efficient equivalent to -// the Go 1.12 reflect.Value.MapRange method. -func mapRange(v reflect.Value) *mapIter { - return &mapIter{v: v} -} - -func (i *mapIter) Next() bool { - if i.keys == nil { - i.keys = i.v.MapKeys() - } else { - i.keys = i.keys[1:] - } - return len(i.keys) > 0 -} - -func (i *mapIter) Key() reflect.Value { - return i.keys[0] -} - -func (i *mapIter) Value() reflect.Value { - return i.v.MapIndex(i.keys[0]) -} diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go b/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go deleted file mode 100644 index 0b31b66eaf8..00000000000 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.12 -// +build go1.12 - -package impl - -import "reflect" - -func mapRange(v reflect.Value) *reflect.MapIter { return v.MapRange() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_message.go b/vendor/google.golang.org/protobuf/internal/impl/codec_message.go index 2f7b363ec4a..111d95833d4 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_message.go @@ -118,12 +118,12 @@ func (mi *MessageInfo) makeCoderMethods(t reflect.Type, si structInfo) { }, } case isOneof: - fieldOffset = offsetOf(fs, mi.Exporter) + fieldOffset = offsetOf(fs) case fd.IsWeak(): fieldOffset = si.weakOffset funcs = makeWeakMessageFieldCoder(fd) default: - fieldOffset = offsetOf(fs, mi.Exporter) + fieldOffset = offsetOf(fs) childMessage, funcs = fieldCoder(fd, ft) } cf := &preallocFields[i] diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go b/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go index 88c16ae5b7c..f81d7d0db9a 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go @@ -45,19 +45,19 @@ func (mi *MessageInfo) makeOpaqueCoderMethods(t reflect.Type, si opaqueStructInf var childMessage *MessageInfo switch { case fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic(): - fieldOffset = offsetOf(fs, mi.Exporter) + fieldOffset = offsetOf(fs) case fd.IsWeak(): fieldOffset = si.weakOffset funcs = makeWeakMessageFieldCoder(fd) case fd.Message() != nil && !fd.IsMap(): - fieldOffset = offsetOf(fs, mi.Exporter) + fieldOffset = offsetOf(fs) if fd.IsList() { childMessage, funcs = makeOpaqueRepeatedMessageFieldCoder(fd, ft) } else { childMessage, funcs = makeOpaqueMessageFieldCoder(fd, ft) } default: - fieldOffset = offsetOf(fs, mi.Exporter) + fieldOffset = offsetOf(fs) childMessage, funcs = fieldCoder(fd, ft) } cf := &coderFieldInfo{ diff --git a/vendor/google.golang.org/protobuf/internal/impl/convert_map.go b/vendor/google.golang.org/protobuf/internal/impl/convert_map.go index 304244a651d..e4580b3ac2e 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/convert_map.go +++ b/vendor/google.golang.org/protobuf/internal/impl/convert_map.go @@ -101,7 +101,7 @@ func (ms *mapReflect) Mutable(k protoreflect.MapKey) protoreflect.Value { return v } func (ms *mapReflect) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - iter := mapRange(ms.v) + iter := ms.v.MapRange() for iter.Next() { k := ms.keyConv.PBValueOf(iter.Key()).MapKey() v := ms.valConv.PBValueOf(iter.Value()) diff --git a/vendor/google.golang.org/protobuf/internal/impl/message.go b/vendor/google.golang.org/protobuf/internal/impl/message.go index fa10a0f5cc9..d1f79b4224f 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message.go @@ -165,28 +165,28 @@ fieldLoop: switch f := t.Field(i); f.Name { case genid.SizeCache_goname, genid.SizeCacheA_goname: if f.Type == sizecacheType { - si.sizecacheOffset = offsetOf(f, mi.Exporter) + si.sizecacheOffset = offsetOf(f) si.sizecacheType = f.Type } case genid.WeakFields_goname, genid.WeakFieldsA_goname: if f.Type == weakFieldsType { - si.weakOffset = offsetOf(f, mi.Exporter) + si.weakOffset = offsetOf(f) si.weakType = f.Type } case genid.UnknownFields_goname, genid.UnknownFieldsA_goname: if f.Type == unknownFieldsAType || f.Type == unknownFieldsBType { - si.unknownOffset = offsetOf(f, mi.Exporter) + si.unknownOffset = offsetOf(f) si.unknownType = f.Type } case genid.ExtensionFields_goname, genid.ExtensionFieldsA_goname, genid.ExtensionFieldsB_goname: if f.Type == extensionFieldsType { - si.extensionOffset = offsetOf(f, mi.Exporter) + si.extensionOffset = offsetOf(f) si.extensionType = f.Type } case "lazyFields", "XXX_lazyUnmarshalInfo": - si.lazyOffset = offsetOf(f, mi.Exporter) + si.lazyOffset = offsetOf(f) case "XXX_presence": - si.presenceOffset = offsetOf(f, mi.Exporter) + si.presenceOffset = offsetOf(f) default: for _, s := range strings.Split(f.Tag.Get("protobuf"), ",") { if len(s) > 0 && strings.Trim(s, "0123456789") == "" { diff --git a/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go b/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go index d7ec53f074a..d8dcd788636 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go @@ -142,7 +142,7 @@ func (mi *MessageInfo) fieldInfoForMapOpaque(si opaqueStructInfo, fd protoreflec if ft.Kind() != reflect.Map { panic(fmt.Sprintf("invalid type: got %v, want map kind", ft)) } - fieldOffset := offsetOf(fs, mi.Exporter) + fieldOffset := offsetOf(fs) conv := NewConverter(ft, fd) return fieldInfo{ fieldDesc: fd, @@ -196,7 +196,7 @@ func (mi *MessageInfo) fieldInfoForScalarListOpaque(si opaqueStructInfo, fd prot panic(fmt.Sprintf("invalid type: got %v, want slice kind", ft)) } conv := NewConverter(reflect.PtrTo(ft), fd) - fieldOffset := offsetOf(fs, mi.Exporter) + fieldOffset := offsetOf(fs) index, _ := presenceIndex(mi.Desc, fd) return fieldInfo{ fieldDesc: fd, @@ -246,7 +246,7 @@ func (mi *MessageInfo) fieldInfoForMessageListOpaque(si opaqueStructInfo, fd pro panic(fmt.Sprintf("invalid type: got %v, want slice kind", ft)) } conv := NewConverter(ft, fd) - fieldOffset := offsetOf(fs, mi.Exporter) + fieldOffset := offsetOf(fs) index, _ := presenceIndex(mi.Desc, fd) fieldNumber := fd.Number() return fieldInfo{ @@ -339,7 +339,7 @@ func (mi *MessageInfo) fieldInfoForMessageListOpaqueNoPresence(si opaqueStructIn panic(fmt.Sprintf("invalid type: got %v, want slice kind", ft)) } conv := NewConverter(ft, fd) - fieldOffset := offsetOf(fs, mi.Exporter) + fieldOffset := offsetOf(fs) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { @@ -411,7 +411,7 @@ func (mi *MessageInfo) fieldInfoForScalarOpaque(si opaqueStructInfo, fd protoref deref = true } conv := NewConverter(ft, fd) - fieldOffset := offsetOf(fs, mi.Exporter) + fieldOffset := offsetOf(fs) index, _ := presenceIndex(mi.Desc, fd) var getter func(p pointer) protoreflect.Value if !nullable { @@ -480,7 +480,7 @@ func (mi *MessageInfo) fieldInfoForScalarOpaque(si opaqueStructInfo, fd protoref func (mi *MessageInfo) fieldInfoForMessageOpaque(si opaqueStructInfo, fd protoreflect.FieldDescriptor, fs reflect.StructField) fieldInfo { ft := fs.Type conv := NewConverter(ft, fd) - fieldOffset := offsetOf(fs, mi.Exporter) + fieldOffset := offsetOf(fs) index, _ := presenceIndex(mi.Desc, fd) fieldNumber := fd.Number() elemType := fs.Type.Elem() diff --git a/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go b/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go index a740646205c..3cd1fbc21fb 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go @@ -76,7 +76,7 @@ func fieldInfoForOneof(fd protoreflect.FieldDescriptor, fs reflect.StructField, isMessage := fd.Message() != nil // TODO: Implement unsafe fast path? - fieldOffset := offsetOf(fs, x) + fieldOffset := offsetOf(fs) return fieldInfo{ // NOTE: The logic below intentionally assumes that oneof fields are // well-formatted. That is, the oneof interface never contains a @@ -152,7 +152,7 @@ func fieldInfoForMap(fd protoreflect.FieldDescriptor, fs reflect.StructField, x conv := NewConverter(ft, fd) // TODO: Implement unsafe fast path? - fieldOffset := offsetOf(fs, x) + fieldOffset := offsetOf(fs) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { @@ -205,7 +205,7 @@ func fieldInfoForList(fd protoreflect.FieldDescriptor, fs reflect.StructField, x conv := NewConverter(reflect.PtrTo(ft), fd) // TODO: Implement unsafe fast path? - fieldOffset := offsetOf(fs, x) + fieldOffset := offsetOf(fs) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { @@ -269,7 +269,7 @@ func fieldInfoForScalar(fd protoreflect.FieldDescriptor, fs reflect.StructField, } } conv := NewConverter(ft, fd) - fieldOffset := offsetOf(fs, x) + fieldOffset := offsetOf(fs) // Generate specialized getter functions to avoid going through reflect.Value if nullable { @@ -333,7 +333,7 @@ func fieldInfoForScalar(fd protoreflect.FieldDescriptor, fs reflect.StructField, } func fieldInfoForWeakMessage(fd protoreflect.FieldDescriptor, weakOffset offset) fieldInfo { - if !flags.ProtoLegacy { + if !flags.ProtoLegacyWeak { panic("no support for proto1 weak fields") } @@ -410,7 +410,7 @@ func fieldInfoForMessage(fd protoreflect.FieldDescriptor, fs reflect.StructField conv := NewConverter(ft, fd) // TODO: Implement unsafe fast path? - fieldOffset := offsetOf(fs, x) + fieldOffset := offsetOf(fs) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { @@ -419,7 +419,7 @@ func fieldInfoForMessage(fd protoreflect.FieldDescriptor, fs reflect.StructField } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if fs.Type.Kind() != reflect.Ptr { - return !isZero(rv) + return !rv.IsZero() } return !rv.IsNil() }, @@ -466,7 +466,7 @@ func makeOneofInfo(od protoreflect.OneofDescriptor, si structInfo, x exporter) * oi := &oneofInfo{oneofDesc: od} if od.IsSynthetic() { fs := si.fieldsByNumber[od.Fields().Get(0).Number()] - fieldOffset := offsetOf(fs, x) + fieldOffset := offsetOf(fs) oi.which = func(p pointer) protoreflect.FieldNumber { if p.IsNil() { return 0 @@ -479,7 +479,7 @@ func makeOneofInfo(od protoreflect.OneofDescriptor, si structInfo, x exporter) * } } else { fs := si.oneofsByName[od.Name()] - fieldOffset := offsetOf(fs, x) + fieldOffset := offsetOf(fs) oi.which = func(p pointer) protoreflect.FieldNumber { if p.IsNil() { return 0 @@ -497,41 +497,3 @@ func makeOneofInfo(od protoreflect.OneofDescriptor, si structInfo, x exporter) * } return oi } - -// isZero is identical to reflect.Value.IsZero. -// TODO: Remove this when Go1.13 is the minimally supported Go version. -func isZero(v reflect.Value) bool { - switch v.Kind() { - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return math.Float64bits(v.Float()) == 0 - case reflect.Complex64, reflect.Complex128: - c := v.Complex() - return math.Float64bits(real(c)) == 0 && math.Float64bits(imag(c)) == 0 - case reflect.Array: - for i := 0; i < v.Len(); i++ { - if !isZero(v.Index(i)) { - return false - } - } - return true - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer: - return v.IsNil() - case reflect.String: - return v.Len() == 0 - case reflect.Struct: - for i := 0; i < v.NumField(); i++ { - if !isZero(v.Field(i)) { - return false - } - } - return true - default: - panic(&reflect.ValueError{Method: "reflect.Value.IsZero", Kind: v.Kind()}) - } -} diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go index 041ebde2de6..6bed45e35c2 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go @@ -22,7 +22,7 @@ type Pointer unsafe.Pointer type offset uintptr // offsetOf returns a field offset for the struct field. -func offsetOf(f reflect.StructField, x exporter) offset { +func offsetOf(f reflect.StructField) offset { return offset(f.Offset) } diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index 386c823aa64..f5c06280fe3 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -52,7 +52,7 @@ import ( const ( Major = 1 Minor = 36 - Patch = 2 + Patch = 3 PreRelease = "" ) diff --git a/vendor/google.golang.org/protobuf/proto/decode.go b/vendor/google.golang.org/protobuf/proto/decode.go index a3b5e142d24..e28d7acb378 100644 --- a/vendor/google.golang.org/protobuf/proto/decode.go +++ b/vendor/google.golang.org/protobuf/proto/decode.go @@ -172,7 +172,7 @@ func (o UnmarshalOptions) unmarshalMessageSlow(b []byte, m protoreflect.Message) var err error if fd == nil { err = errUnknown - } else if flags.ProtoLegacy { + } else if flags.ProtoLegacyWeak { if fd.IsWeak() && fd.Message().IsPlaceholder() { err = errUnknown // weak referent is not linked in } diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go index 6de31c2ebdb..5eaf652176c 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go @@ -149,7 +149,7 @@ func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds return errors.New("message field %q under proto3 optional semantics must be within a single element oneof", f.FullName()) } } - if f.IsWeak() && !flags.ProtoLegacy { + if f.IsWeak() && !flags.ProtoLegacyWeak { return errors.New("message field %q is a weak field, which is a legacy proto1 feature that is no longer supported", f.FullName()) } if f.IsWeak() && (!f.HasPresence() || !isOptionalMessage(f) || f.ContainingOneof() != nil) { diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go b/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go index bf0a0ccdeed..f55b0369596 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go @@ -125,16 +125,27 @@ func mergeEditionFeatures(parentDesc protoreflect.Descriptor, child *descriptorp parentFS.IsJSONCompliant = *jf == descriptorpb.FeatureSet_ALLOW } - if goFeatures, ok := proto.GetExtension(child, gofeaturespb.E_Go).(*gofeaturespb.GoFeatures); ok && goFeatures != nil { - if luje := goFeatures.LegacyUnmarshalJsonEnum; luje != nil { - parentFS.GenerateLegacyUnmarshalJSON = *luje - } - if sep := goFeatures.StripEnumPrefix; sep != nil { - parentFS.StripEnumPrefix = int(*sep) - } - if al := goFeatures.ApiLevel; al != nil { - parentFS.APILevel = int(*al) - } + // We must not use proto.GetExtension(child, gofeaturespb.E_Go) + // because that only works for messages we generated, but not for + // dynamicpb messages. See golang/protobuf#1669. + goFeatures := child.ProtoReflect().Get(gofeaturespb.E_Go.TypeDescriptor()) + if !goFeatures.IsValid() { + return parentFS + } + // gf.Interface() could be *dynamicpb.Message or *gofeaturespb.GoFeatures. + gf := goFeatures.Message() + fields := gf.Descriptor().Fields() + + if fd := fields.ByName("legacy_unmarshal_json_enum"); gf.Has(fd) { + parentFS.GenerateLegacyUnmarshalJSON = gf.Get(fd).Bool() + } + + if fd := fields.ByName("strip_enum_prefix"); gf.Has(fd) { + parentFS.StripEnumPrefix = int(gf.Get(fd).Enum()) + } + + if fd := fields.ByName("api_level"); gf.Has(fd) { + parentFS.APILevel = int(gf.Get(fd).Enum()) } return parentFS diff --git a/vendor/google.golang.org/protobuf/types/dynamicpb/types.go b/vendor/google.golang.org/protobuf/types/dynamicpb/types.go index c432817bb9c..8e759fc9f72 100644 --- a/vendor/google.golang.org/protobuf/types/dynamicpb/types.go +++ b/vendor/google.golang.org/protobuf/types/dynamicpb/types.go @@ -28,11 +28,7 @@ type extField struct { type Types struct { // atomicExtFiles is used with sync/atomic and hence must be the first word // of the struct to guarantee 64-bit alignment. - // - // TODO(stapelberg): once we only support Go 1.19 and newer, switch this - // field to be of type atomic.Uint64 to guarantee alignment on - // stack-allocated values, too. - atomicExtFiles uint64 + atomicExtFiles atomic.Uint64 extMu sync.Mutex files *protoregistry.Files @@ -90,7 +86,7 @@ func (t *Types) FindExtensionByName(name protoreflect.FullName) (protoreflect.Ex func (t *Types) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { // Construct the extension number map lazily, since not every user will need it. // Update the map if new files are added to the registry. - if atomic.LoadUint64(&t.atomicExtFiles) != uint64(t.files.NumFiles()) { + if t.atomicExtFiles.Load() != uint64(t.files.NumFiles()) { t.updateExtensions() } xd := t.extensionsByMessage[extField{message, field}] @@ -133,10 +129,10 @@ func (t *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) { func (t *Types) updateExtensions() { t.extMu.Lock() defer t.extMu.Unlock() - if atomic.LoadUint64(&t.atomicExtFiles) == uint64(t.files.NumFiles()) { + if t.atomicExtFiles.Load() == uint64(t.files.NumFiles()) { return } - defer atomic.StoreUint64(&t.atomicExtFiles, uint64(t.files.NumFiles())) + defer t.atomicExtFiles.Store(uint64(t.files.NumFiles())) t.files.RangeFiles(func(fd protoreflect.FileDescriptor) bool { t.registerExtensions(fd.Extensions()) t.registerExtensionsInMessages(fd.Messages()) diff --git a/vendor/modules.txt b/vendor/modules.txt index 772d3c16f72..ede54c12a9a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -548,7 +548,7 @@ google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap google.golang.org/grpc/test/bufconn -# google.golang.org/protobuf v1.36.2 +# google.golang.org/protobuf v1.36.3 ## explicit; go 1.21 google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext From 679b07e359b7bc636c8134121e674cbe497fd6db Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Thu, 16 Jan 2025 16:47:19 +0200 Subject: [PATCH 13/14] add internalize scripts --- internalize.patch | 198 ++++++++++++++++++++++++++++++++++++++ internalize.sh | 36 +++++++ publicly_used_imports.txt | 25 +++++ 3 files changed, 259 insertions(+) create mode 100644 internalize.patch create mode 100755 internalize.sh create mode 100644 publicly_used_imports.txt diff --git a/internalize.patch b/internalize.patch new file mode 100644 index 00000000000..6ed13244cea --- /dev/null +++ b/internalize.patch @@ -0,0 +1,198 @@ +diff --git a/.github/workflows/tc39.yml b/.github/workflows/tc39.yml +index bd223f97a..e82421110 100644 +--- a/.github/workflows/tc39.yml ++++ b/.github/workflows/tc39.yml +@@ -27,6 +27,6 @@ jobs: + - name: Run tests + run: | + set -x +- cd js/tc39 ++ cd internal/js/tc39 + sh checkout.sh + go test -timeout 1h +diff --git a/.github/workflows/wpt.yml b/.github/workflows/wpt.yml +index 1cd84215e..e2f14adbd 100644 +--- a/.github/workflows/wpt.yml ++++ b/.github/workflows/wpt.yml +@@ -22,12 +22,12 @@ jobs: + - name: Run Streams Tests + run: | + set -x +- cd js/modules/k6/experimental/streams/tests ++ cd internal/js/modules/k6/experimental/streams/tests + sh checkout.sh + go test ../... -tags=wpt + - name: Run Webcrypto Tests + run: | + set -x +- cd js/modules/k6/webcrypto/tests ++ cd internal/js/modules/k6/webcrypto/tests + sh checkout.sh + go test ./... -tags=wpt +diff --git a/.gitignore b/.gitignore +index 3a37d8837..bdce1071f 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -2,8 +2,8 @@ + /k6.exe + /dist + /pkg-build +-/js/tc39/TestTC39 +-/js/modules/k6/experimental/streams/tests/wpt ++/internal/js/tc39/TestTC39 ++/internal/js/modules/k6/experimental/streams/tests/wpt + + .vscode + *.sublime-workspace +@@ -36,4 +36,4 @@ script.js + /packaging/*.gpg + + # web platform tests +-js/modules/k6/webcrypto/tests/wpt/ ++/internal/js/modules/k6/webcrypto/tests/wpt/ +diff --git a/cmd/execute.go b/cmd/execute.go +new file mode 100644 +index 000000000..e84f839ba +--- /dev/null ++++ b/cmd/execute.go +@@ -0,0 +1,10 @@ ++// Package cmd is here to provide a way for xk6 to build a binary with added extensions ++package cmd ++ ++import "go.k6.io/k6/internal/cmd" ++ ++// Execute exectues the k6 command ++// It only is exported here for backwards compatibility and the ability to use xk6 to build extended k6 ++func Execute() { ++ cmd.Execute() ++} +diff --git a/cmd/tests/global_state.go b/cmd/tests/global_state.go +new file mode 100644 +index 000000000..2b06bbf11 +--- /dev/null ++++ b/cmd/tests/global_state.go +@@ -0,0 +1,17 @@ ++// Package tests contains types needed for running integration tests that run k6 commands. ++package tests ++ ++import ( ++ "testing" ++ ++ "go.k6.io/k6/internal/cmd/tests" ++) ++ ++// GlobalTestState is a wrapper around GlobalState for use in tests. ++type GlobalTestState = tests.GlobalTestState ++ ++// NewGlobalTestState returns an initialized GlobalTestState, mocking all ++// GlobalState fields for use in tests. ++func NewGlobalTestState(tb testing.TB) *GlobalTestState { ++ return tests.NewGlobalTestState(tb) ++} +diff --git a/internal/cmd/tests/cmd_run_grpc_test.go b/internal/cmd/tests/cmd_run_grpc_test.go +index 6783f4e11..a7399db44 100644 +--- a/internal/cmd/tests/cmd_run_grpc_test.go ++++ b/internal/cmd/tests/cmd_run_grpc_test.go +@@ -12,7 +12,7 @@ import ( + "github.com/stretchr/testify/require" + ) + +-const projectRootPath = "../../" ++const projectRootPath = "../../../" + + // TestGRPCInputOutput runs same k6's scripts that we have in example folder + // it check that output contains/not contains cetane things +@@ -90,7 +90,7 @@ func TestGRPCInputOutput(t *testing.T) { + + // Read the proto file from the testutils package + // it's same that we use in the examples +- proto, err := os.ReadFile(projectRootPath + "lib/testutils/grpcservice/route_guide.proto") //nolint:forbidigo ++ proto, err := os.ReadFile(projectRootPath + "internal/lib/testutils/grpcservice/route_guide.proto") //nolint:forbidigo + require.NoError(t, err) + + for name, test := range tc { +diff --git a/internal/js/eventloop/eventloop_test.go b/internal/js/eventloop/eventloop_test.go +index 459960d7e..ed4f87877 100644 +--- a/internal/js/eventloop/eventloop_test.go ++++ b/internal/js/eventloop/eventloop_test.go +@@ -199,7 +199,7 @@ func TestEventLoopRejectGoError(t *testing.T) { + return err + }) + loop.WaitOnRegistered() +- require.EqualError(t, err, "Uncaught (in promise) GoError: some error\n\tat go.k6.io/k6/js/eventloop_test.TestEventLoopRejectGoError.func1 (native)\n\tat :1:31(2)\n") ++ require.EqualError(t, err, "Uncaught (in promise) GoError: some error\n\tat go.k6.io/k6/internal/js/eventloop_test.TestEventLoopRejectGoError.func1 (native)\n\tat :1:31(2)\n") + } + + func TestEventLoopRejectThrow(t *testing.T) { +@@ -216,7 +216,7 @@ func TestEventLoopRejectThrow(t *testing.T) { + return err + }) + loop.WaitOnRegistered() +- require.EqualError(t, err, "Uncaught (in promise) GoError: throw error\n\tat go.k6.io/k6/js/eventloop_test.TestEventLoopRejectThrow.func1 (native)\n\tat :1:31(2)\n") ++ require.EqualError(t, err, "Uncaught (in promise) GoError: throw error\n\tat go.k6.io/k6/internal/js/eventloop_test.TestEventLoopRejectThrow.func1 (native)\n\tat :1:31(2)\n") + } + + func TestEventLoopAsyncAwait(t *testing.T) { +diff --git a/internal/js/modules/k6/webcrypto/cmd_run_test.go b/internal/js/modules/k6/webcrypto/cmd_run_test.go +index 68df57aaf..3ee0692fd 100644 +--- a/internal/js/modules/k6/webcrypto/cmd_run_test.go ++++ b/internal/js/modules/k6/webcrypto/cmd_run_test.go +@@ -51,7 +51,7 @@ func TestExamplesInputOutput(t *testing.T) { + "level=error", // no error messages + } + +- const examplesDir = "../../../../examples/webcrypto" ++ const examplesDir = "../../../../../examples/webcrypto" + + // List of the directories containing the examples + // that we should run and check that they produce the expected output +diff --git a/lib/testutils/httpmultibin/nested_types/nested_types.proto b/internal/lib/testutils/httpmultibin/nested_types/nested_types.proto +similarity index 100% +rename from lib/testutils/httpmultibin/nested_types/nested_types.proto +rename to internal/lib/testutils/httpmultibin/nested_types/nested_types.proto +diff --git a/js/modules/require_impl.go b/js/modules/require_impl.go +index 5d10dd515..71098ec37 100644 +--- a/js/modules/require_impl.go ++++ b/js/modules/require_impl.go +@@ -202,7 +202,7 @@ func getPreviousRequiringFile(vu VU) (string, error) { + + for i, frame := range frames[1:] { // first one should be the current require + // TODO have this precalculated automatically +- if frame.FuncName() == "go.k6.io/k6/js.(*requireImpl).require-fm" { ++ if frame.FuncName() == "go.k6.io/k6/internal/js.(*requireImpl).require-fm" { + // we need to get the one *before* but as we skip the first one the index matches ;) + result := frames[i].SrcName() + if result == "file:///-" { +diff --git a/main.go b/main.go +index d2b2a33f8..84212739b 100644 +--- a/main.go ++++ b/main.go +@@ -2,7 +2,7 @@ + package main + + import ( +- "go.k6.io/k6/internal/cmd" ++ "go.k6.io/k6/cmd" + ) + + func main() { + "go.k6.io/k6/js/modulestest" + + "github.com/stretchr/testify/require" +diff --git a/internal/js/modules/k6/webcrypto/tests/test_setup_test.go b/internal/js/modules/k6/webcrypto/tests/test_setup_test.go +index 42d42b9a9..2abab430d 100644 +--- a/internal/js/modules/k6/webcrypto/tests/test_setup_test.go ++++ b/internal/js/modules/k6/webcrypto/tests/test_setup_test.go +@@ -5,9 +5,9 @@ package tests + import ( + "testing" + +- "go.k6.io/k6/js/compiler" +- k6encoding "go.k6.io/k6/js/modules/k6/encoding" +- "go.k6.io/k6/js/modules/k6/webcrypto" ++ "go.k6.io/k6/internal/js/compiler" ++ k6encoding "go.k6.io/k6/internal/js/modules/k6/encoding" ++ "go.k6.io/k6/internal/js/modules/k6/webcrypto" + "go.k6.io/k6/js/modulestest" + + "github.com/stretchr/testify/require" diff --git a/internalize.sh b/internalize.sh new file mode 100755 index 00000000000..6d306176b1b --- /dev/null +++ b/internalize.sh @@ -0,0 +1,36 @@ +#!/bin/sh +mvpkg --help &>/dev/null || (echo "you need mvpkg run 'go install github.com/vikstrous/mvpkg@latest'" && exit 1) +mkdir -p internal + +list=`comm -3 <(go list ./... | grep -v '^go.k6.io/k6/internal' | sort | uniq) <( cat publicly_used_imports.txt )` + +for i in $list; do + if [[ $i == "go.k6.io/k6" ]] then + continue + fi + i=${i##go.k6.io/k6/} + + mvpkg $i internal/$i + find $i -maxdepth 1 -type f | xargs -I '{}' -n 1 git mv '{}' internal/$i +done + +git mv cmd/testdata internal/cmd/testdata +git mv cmd/tests/testdata internal/cmd/tests/testdata +git mv js/modules/k6/browser/tests/static internal/js/modules/k6/browser/tests/static +git mv js/modules/k6/webcrypto/tests internal/js/modules/k6/webcrypto/tests +git mv js/modules/k6/experimental/streams/tests internal/js/modules/k6/experimental/streams/tests +git mv js/modules/k6/experimental/websockets/autobahn_tests internal/js/modules/k6/experimental/websockets/autobahn_tests +git mv lib/testutils/httpmultibin/grpc_protoset_testing internal/lib/testutils/httpmultibin/grpc_protoset_testing +git mv output/cloud/expv2/integration/testdata internal/output/cloud/expv2/integration/testdata + +git apply internalize.patch + +# clean empty folders that are left over after all the moving +while find -type d -empty | grep -v .git | xargs rm -r &>/dev/null +do + true +done + +git add internal +git add cmd +git commit -a -n -m "chore: Move not publicly used APIs in internal package" diff --git a/publicly_used_imports.txt b/publicly_used_imports.txt new file mode 100644 index 00000000000..b22c4f6a85a --- /dev/null +++ b/publicly_used_imports.txt @@ -0,0 +1,25 @@ +go.k6.io/k6/api/v1 +go.k6.io/k6/api/v1/client +go.k6.io/k6/cloudapi +go.k6.io/k6/cmd/state +go.k6.io/k6/errext +go.k6.io/k6/errext/exitcodes +go.k6.io/k6/ext +go.k6.io/k6/js/common +go.k6.io/k6/js/modules +go.k6.io/k6/js/modules/k6 +go.k6.io/k6/js/modules/k6/html +go.k6.io/k6/js/modules/k6/http +go.k6.io/k6/js/modulestest +go.k6.io/k6/js/promises +go.k6.io/k6/lib +go.k6.io/k6/lib/consts +go.k6.io/k6/lib/executor +go.k6.io/k6/lib/fsext +go.k6.io/k6/lib/netext +go.k6.io/k6/lib/netext/httpext +go.k6.io/k6/lib/types +go.k6.io/k6/metrics +go.k6.io/k6/output +go.k6.io/k6/output/cloud/expv2 +go.k6.io/k6/output/csv From 7129195a85e57533564e46086018e43915d27945 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Wed, 22 Jan 2025 15:59:34 +0200 Subject: [PATCH 14/14] chore: Move not publicly used APIs in internal package --- .github/workflows/tc39.yml | 2 +- .github/workflows/wpt.yml | 4 +-- .gitignore | 6 ++-- api/v1/control_surface.go | 4 +-- api/v1/group_routes_test.go | 12 +++---- api/v1/metric_routes_test.go | 2 +- api/v1/setup_teardown_routes_test.go | 10 +++--- api/v1/status_routes.go | 2 +- api/v1/status_routes_test.go | 8 ++--- cloudapi/api_test.go | 2 +- cloudapi/logs_test.go | 4 +-- cmd/execute.go | 10 ++++++ cmd/state/state.go | 4 +-- cmd/tests/global_state.go | 17 ++++++++++ {api => internal/api}/server.go | 4 +-- {api => internal/api}/server_test.go | 2 +- .../cloudapi}/insights/client.go | 2 +- .../cloudapi}/insights/client_test.go | 2 +- .../cloudapi}/insights/doc.go | 0 .../cloudapi}/insights/domain.go | 0 .../cloudapi}/insights/mappers.go | 4 +-- .../cloudapi}/insights/mappers_test.go | 4 +-- .../cloudapi}/insights/proto/gen.go | 0 .../insights/proto/v1/common/common.pb.go | 0 .../insights/proto/v1/common/common.proto | 0 .../insights/proto/v1/ingester/ingester.pb.go | 4 +-- .../insights/proto/v1/ingester/ingester.proto | 0 .../proto/v1/ingester/ingester_grpc.pb.go | 0 .../insights/proto/v1/k6/labels.pb.go | 0 .../insights/proto/v1/k6/labels.proto | 0 .../proto/v1/k6/request_metadata.pb.go | 0 .../proto/v1/k6/request_metadata.proto | 0 .../insights/proto/v1/trace/labels.pb.go | 0 .../insights/proto/v1/trace/labels.proto | 0 .../insights/proto/v1/trace/span.pb.go | 2 +- .../insights/proto/v1/trace/span.proto | 0 {cmd => internal/cmd}/archive.go | 0 {cmd => internal/cmd}/archive_test.go | 4 +-- {cmd => internal/cmd}/builtin_output_gen.go | 0 {cmd => internal/cmd}/cloud.go | 2 +- {cmd => internal/cmd}/cloud_login.go | 2 +- {cmd => internal/cmd}/cloud_run.go | 4 +-- {cmd => internal/cmd}/cloud_upload.go | 0 {cmd => internal/cmd}/common.go | 0 {cmd => internal/cmd}/config.go | 0 .../cmd}/config_consolidation_test.go | 2 +- {cmd => internal/cmd}/config_test.go | 0 {cmd => internal/cmd}/doc.go | 0 {cmd => internal/cmd}/inspect.go | 0 {cmd => internal/cmd}/login.go | 0 {cmd => internal/cmd}/login_cloud.go | 2 +- {cmd => internal/cmd}/login_influxdb.go | 4 +-- {cmd => internal/cmd}/new.go | 2 +- {cmd => internal/cmd}/new_test.go | 2 +- {cmd => internal/cmd}/options.go | 0 {cmd => internal/cmd}/options_test.go | 0 {cmd => internal/cmd}/outputs.go | 6 ++-- {cmd => internal/cmd}/outputs_cloud.go | 0 {cmd => internal/cmd}/outputs_test.go | 0 {cmd => internal/cmd}/pause.go | 0 {cmd => internal/cmd}/report.go | 4 +-- {cmd => internal/cmd}/report_test.go | 8 ++--- {cmd => internal/cmd}/resume.go | 0 {cmd => internal/cmd}/root.go | 2 +- {cmd => internal/cmd}/root_test.go | 2 +- {cmd => internal/cmd}/run.go | 14 ++++---- {cmd => internal/cmd}/run_test.go | 4 +-- {cmd => internal/cmd}/runtime_options.go | 0 {cmd => internal/cmd}/runtime_options_test.go | 6 ++-- {cmd => internal/cmd}/scale.go | 0 {cmd => internal/cmd}/stats.go | 0 {cmd => internal/cmd}/status.go | 0 .../cmd}/stdlog_integration_test.go | 4 +-- {cmd => internal/cmd}/templates/browser.js | 0 {cmd => internal/cmd}/templates/minimal.js | 0 {cmd => internal/cmd}/templates/protocol.js | 0 {cmd => internal/cmd}/templates/templates.go | 0 {cmd => internal/cmd}/test_load.go | 6 ++-- {cmd => internal/cmd}/testdata/abort.js | 0 .../cmd}/testdata/abort_initerr.js | 0 .../cmd}/testdata/abort_initvu.js | 0 .../cmd}/testdata/abort_teardown.js | 0 {cmd => internal/cmd}/testdata/example.har | 0 {cmd => internal/cmd}/testdata/example.js | 0 {cmd => internal/cmd}/testdata/initerr.js | 0 .../cmd}/testdata/invalidconfig/invalid.json | 0 .../testdata/invalidconfig/invalid_option.js | 0 .../invalidconfig/invalid_scenario.js | 0 .../cmd}/testdata/invalidconfig/option_env.js | 0 .../testdata/thresholds/empty_sink_no_nan.js | 0 .../thresholds/malformed_expression.js | 0 .../thresholds/name_contains_tokens.js | 0 .../thresholds/non_existing_metric.js | 0 ...thresholds_on_submetric_without_samples.js | 0 .../unsupported_aggregation_method.js | 0 .../cmd}/tests/cmd_cloud_run_test.go | 2 +- {cmd => internal/cmd}/tests/cmd_cloud_test.go | 4 +-- .../cmd}/tests/cmd_cloud_upload_test.go | 4 +-- .../cmd}/tests/cmd_run_grpc_test.go | 6 ++-- {cmd => internal/cmd}/tests/cmd_run_test.go | 10 +++--- {cmd => internal/cmd}/tests/doc.go | 0 {cmd => internal/cmd}/tests/eventloop_test.go | 2 +- {cmd => internal/cmd}/tests/events/events.go | 2 +- {cmd => internal/cmd}/tests/grpc.go | 2 +- {cmd => internal/cmd}/tests/test_state.go | 6 ++-- .../archives/archive_v0.42.0_linux.tar | Bin .../archives/archive_v0.42.0_windows.tar | Bin ...archive_v0.46.0_with_loadimpact_option.tar | Bin {cmd => internal/cmd}/tests/tests.go | 0 {cmd => internal/cmd}/tests/tests_test.go | 2 +- {cmd => internal/cmd}/ui.go | 4 +-- {cmd => internal/cmd}/ui_test.go | 2 +- {cmd => internal/cmd}/ui_unix.go | 0 {cmd => internal/cmd}/ui_windows.go | 0 {cmd => internal/cmd}/version.go | 0 {cmd => internal/cmd}/version_test.go | 2 +- {event => internal/event}/doc.go | 0 {event => internal/event}/event.go | 0 {event => internal/event}/system.go | 0 {event => internal/event}/system_test.go | 0 {event => internal/event}/type.go | 0 {event => internal/event}/type_gen.go | 0 {execution => internal/execution}/abort.go | 0 .../execution}/controller.go | 0 .../execution}/local/controller.go | 0 {execution => internal/execution}/pkg.go | 0 .../execution}/scheduler.go | 2 +- .../execution}/scheduler_ext_exec_test.go | 8 ++--- .../execution}/scheduler_ext_test.go | 18 +++++------ .../execution}/scheduler_int_test.go | 6 ++-- {js => internal/js}/bundle.go | 8 ++--- {js => internal/js}/bundle_test.go | 6 ++-- {js => internal/js}/compiler/compiler.go | 2 +- {js => internal/js}/compiler/compiler_test.go | 2 +- {js => internal/js}/compiler/enhanced.go | 0 {js => internal/js}/compiler/enhanced_test.go | 2 +- {js => internal/js}/console.go | 0 {js => internal/js}/console_test.go | 6 ++-- {js => internal/js}/doc.go | 0 .../js}/empty_iterations_bench_test.go | 0 {js => internal/js}/esm_vs_commonjs_test.go | 0 {js => internal/js}/eventloop/eventloop.go | 0 .../js}/eventloop/eventloop_test.go | 6 ++-- {js => internal/js}/http_bench_test.go | 2 +- {js => internal/js}/init_and_modules_test.go | 8 ++--- {js => internal/js}/initcontext.go | 2 +- {js => internal/js}/initcontext_test.go | 0 {js => internal/js}/jsmodules.go | 30 +++++++++--------- {js => internal/js}/module_loading_test.go | 2 +- .../browser/browser_context_mapping.go | 6 ++-- .../browser/browser_context_options_test.go | 4 +-- .../k6/browser/browser/browser_mapping.go | 4 +-- .../browser/console_message_mapping.go | 2 +- .../browser/browser/element_handle_mapping.go | 4 +-- .../k6/browser/browser/file_persister.go | 4 +-- .../k6/browser/browser/file_persister_test.go | 4 +-- .../k6/browser/browser/frame_mapping.go | 4 +-- .../js}/modules/k6/browser/browser/helpers.go | 4 +-- .../k6/browser/browser/helpers_test.go | 0 .../k6/browser/browser/js_handle_mapping.go | 4 +-- .../k6/browser/browser/keyboard_mapping.go | 4 +-- .../k6/browser/browser/locator_mapping.go | 4 +-- .../js}/modules/k6/browser/browser/mapping.go | 2 +- .../k6/browser/browser/mapping_test.go | 2 +- .../browser/browser/metric_event_mapping.go | 2 +- .../js}/modules/k6/browser/browser/module.go | 6 ++-- .../modules/k6/browser/browser/module_test.go | 2 +- .../modules/k6/browser/browser/modulevu.go | 4 +-- .../k6/browser/browser/mouse_mapping.go | 4 +-- .../k6/browser/browser/page_mapping.go | 4 +-- .../modules/k6/browser/browser/registry.go | 12 +++---- .../k6/browser/browser/registry_test.go | 6 ++-- .../k6/browser/browser/request_mapping.go | 4 +-- .../k6/browser/browser/response_mapping.go | 4 +-- .../k6/browser/browser/touchscreen_mapping.go | 4 +-- .../k6/browser/browser/worker_mapping.go | 2 +- .../modules/k6/browser/chromium/browser.go | 2 +- .../k6/browser/chromium/browser_type.go | 10 +++--- .../k6/browser/chromium/browser_type_test.go | 4 +-- .../js}/modules/k6/browser/common/barrier.go | 0 .../modules/k6/browser/common/barrier_test.go | 2 +- .../js}/modules/k6/browser/common/browser.go | 4 +-- .../k6/browser/common/browser_context.go | 8 ++--- .../browser/common/browser_context_options.go | 0 .../k6/browser/common/browser_context_test.go | 8 ++--- .../k6/browser/common/browser_options.go | 4 +-- .../k6/browser/common/browser_options_test.go | 6 ++-- .../k6/browser/common/browser_process.go | 4 +-- .../k6/browser/common/browser_process_meta.go | 2 +- .../k6/browser/common/browser_process_test.go | 0 .../modules/k6/browser/common/browser_test.go | 6 ++-- .../modules/k6/browser/common/connection.go | 2 +- .../k6/browser/common/connection_test.go | 4 +-- .../js}/modules/k6/browser/common/consts.go | 0 .../js}/modules/k6/browser/common/context.go | 0 .../modules/k6/browser/common/context_test.go | 0 .../js}/modules/k6/browser/common/device.go | 0 .../js}/modules/k6/browser/common/doc.go | 0 .../k6/browser/common/element_handle.go | 4 +-- .../browser/common/element_handle_options.go | 2 +- .../k6/browser/common/element_handle_test.go | 2 +- .../js}/modules/k6/browser/common/errors.go | 0 .../k6/browser/common/event_emitter.go | 0 .../k6/browser/common/event_emitter_test.go | 0 .../k6/browser/common/execution_context.go | 4 +-- .../js}/modules/k6/browser/common/frame.go | 4 +-- .../k6/browser/common/frame_manager.go | 4 +-- .../k6/browser/common/frame_options.go | 2 +- .../k6/browser/common/frame_options_test.go | 2 +- .../k6/browser/common/frame_session.go | 4 +-- .../modules/k6/browser/common/frame_test.go | 4 +-- .../js}/modules/k6/browser/common/helpers.go | 2 +- .../modules/k6/browser/common/helpers_test.go | 2 +- .../js}/modules/k6/browser/common/hooks.go | 0 .../js}/modules/k6/browser/common/http.go | 4 +-- .../modules/k6/browser/common/http_test.go | 4 +-- .../modules/k6/browser/common/js/actions.go | 0 .../js}/modules/k6/browser/common/js/doc.go | 0 .../k6/browser/common/js/embedded_scripts.go | 0 .../k6/browser/common/js/injected_script.js | 0 .../modules/k6/browser/common/js/query_all.js | 0 .../k6/browser/common/js/scroll_into_view.js | 0 .../modules/k6/browser/common/js/selectors.go | 0 .../k6/browser/common/js/web_vital_iife.js | 0 .../k6/browser/common/js/web_vital_init.js | 0 .../modules/k6/browser/common/js_handle.go | 2 +- .../js}/modules/k6/browser/common/keyboard.go | 2 +- .../k6/browser/common/keyboard_test.go | 4 +-- .../modules/k6/browser/common/kill_linux.go | 0 .../modules/k6/browser/common/kill_other.go | 0 .../js}/modules/k6/browser/common/layout.go | 2 +- .../modules/k6/browser/common/layout_test.go | 0 .../modules/k6/browser/common/lifecycle.go | 0 .../k6/browser/common/lifecycle_test.go | 0 .../js}/modules/k6/browser/common/locator.go | 2 +- .../js}/modules/k6/browser/common/mouse.go | 0 .../k6/browser/common/mouse_options.go | 2 +- .../k6/browser/common/network_manager.go | 4 +-- .../k6/browser/common/network_manager_test.go | 8 ++--- .../k6/browser/common/network_profile.go | 0 .../js}/modules/k6/browser/common/page.go | 4 +-- .../modules/k6/browser/common/page_options.go | 2 +- .../modules/k6/browser/common/page_test.go | 0 .../k6/browser/common/remote_object.go | 2 +- .../k6/browser/common/remote_object_test.go | 2 +- .../k6/browser/common/screenshotter.go | 2 +- .../modules/k6/browser/common/selectors.go | 0 .../js}/modules/k6/browser/common/session.go | 2 +- .../modules/k6/browser/common/session_test.go | 4 +-- .../js}/modules/k6/browser/common/timeout.go | 0 .../modules/k6/browser/common/timeout_test.go | 0 .../modules/k6/browser/common/touchscreen.go | 0 .../js}/modules/k6/browser/common/trace.go | 2 +- .../js}/modules/k6/browser/common/worker.go | 0 .../js}/modules/k6/browser/env/env.go | 0 .../modules/k6/browser/k6error/internal.go | 0 .../js}/modules/k6/browser/k6ext/context.go | 0 .../js}/modules/k6/browser/k6ext/doc.go | 0 .../modules/k6/browser/k6ext/k6test/doc.go | 0 .../k6/browser/k6ext/k6test/executor.go | 0 .../js}/modules/k6/browser/k6ext/k6test/vu.go | 12 +++---- .../js}/modules/k6/browser/k6ext/metrics.go | 0 .../js}/modules/k6/browser/k6ext/panic.go | 0 .../js}/modules/k6/browser/k6ext/promise.go | 0 .../k6/browser/keyboardlayout/layout.go | 0 .../modules/k6/browser/keyboardlayout/us.go | 0 .../js}/modules/k6/browser/log/logger.go | 0 .../k6/browser/storage/file_persister.go | 0 .../k6/browser/storage/file_persister_test.go | 0 .../js}/modules/k6/browser/storage/storage.go | 0 .../k6/browser/storage/storage_test.go | 0 .../tests/browser_context_options_test.go | 2 +- .../k6/browser/tests/browser_context_test.go | 4 +-- .../modules/k6/browser/tests/browser_test.go | 10 +++--- .../k6/browser/tests/browser_type_test.go | 8 ++--- .../js}/modules/k6/browser/tests/doc.go | 0 .../k6/browser/tests/element_handle_test.go | 2 +- .../k6/browser/tests/frame_manager_test.go | 2 +- .../modules/k6/browser/tests/frame_test.go | 4 +-- .../js}/modules/k6/browser/tests/helpers.go | 4 +-- .../tests/js_handle_get_properties_test.go | 0 .../k6/browser/tests/js_handle_test.go | 0 .../modules/k6/browser/tests/keyboard_test.go | 4 +-- .../tests/launch_options_slowmo_test.go | 2 +- .../k6/browser/tests/lifecycle_wait_test.go | 2 +- .../modules/k6/browser/tests/locator_test.go | 2 +- .../modules/k6/browser/tests/logrus_hook.go | 0 .../modules/k6/browser/tests/mouse_test.go | 0 .../k6/browser/tests/network_manager_test.go | 2 +- .../js}/modules/k6/browser/tests/page_test.go | 4 +-- .../k6/browser/tests/remote_obj_test.go | 2 +- .../k6/browser/tests/setinputfiles_test.go | 2 +- .../browser/tests/static/concealed_link.html | 0 .../k6/browser/tests/static/dialog.html | 0 .../browser/tests/static/embedded_iframe.html | 0 .../k6/browser/tests/static/iframe_home.html | 0 .../browser/tests/static/iframe_signin.html | 0 .../tests/static/iframe_test_main.html | 0 .../tests/static/iframe_test_nested1.html | 0 .../tests/static/iframe_test_nested2.html | 0 .../k6/browser/tests/static/lifecycle.html | 0 .../tests/static/lifecycle_main_frame.html | 0 .../tests/static/lifecycle_no_ping_js.html | 0 .../k6/browser/tests/static/locators.html | 0 .../k6/browser/tests/static/mouse_helper.js | 0 .../k6/browser/tests/static/nav_in_doc.html | 0 .../browser/tests/static/non_clickable.html | 0 .../k6/browser/tests/static/page1.html | 0 .../k6/browser/tests/static/page2.html | 0 .../modules/k6/browser/tests/static/ping.html | 0 .../browser/tests/static/select_options.html | 0 .../tests/static/shadow_and_doc_frag.html | 0 .../browser/tests/static/shadow_dom_link.html | 0 .../k6/browser/tests/static/usual.html | 0 .../k6/browser/tests/static/visible.html | 0 .../k6/browser/tests/static/wait_for.html | 0 .../k6/browser/tests/static/wait_until.html | 0 .../k6/browser/tests/static/web_vitals.html | 0 .../modules/k6/browser/tests/test_browser.go | 12 +++---- .../k6/browser/tests/test_browser_proxy.go | 0 .../k6/browser/tests/test_browser_test.go | 2 +- .../modules/k6/browser/tests/tracing_test.go | 6 ++-- .../modules/k6/browser/tests/webvital_test.go | 2 +- .../js}/modules/k6/browser/tests/ws/server.go | 0 .../js}/modules/k6/browser/trace/trace.go | 0 .../js}/modules/k6/crypto/crypto.go | 0 .../js}/modules/k6/crypto/crypto_test.go | 0 .../js}/modules/k6/crypto/x509/x509.go | 0 .../js}/modules/k6/crypto/x509/x509_test.go | 0 {js => internal/js}/modules/k6/data/data.go | 0 {js => internal/js}/modules/k6/data/share.go | 0 .../js}/modules/k6/data/share_test.go | 2 +- .../js}/modules/k6/encoding/encoding.go | 0 .../js}/modules/k6/encoding/encoding_test.go | 0 .../js}/modules/k6/execution/execution.go | 0 .../modules/k6/execution/execution_test.go | 2 +- .../js}/modules/k6/experimental/README.md | 0 .../js}/modules/k6/experimental/csv/module.go | 4 +-- .../k6/experimental/csv/module_test.go | 4 +-- .../js}/modules/k6/experimental/csv/reader.go | 0 .../k6/experimental/csv/reader_test.go | 0 .../modules/k6/experimental/experimental.go | 0 .../js}/modules/k6/experimental/fs/cache.go | 0 .../modules/k6/experimental/fs/cache_test.go | 0 .../js}/modules/k6/experimental/fs/errors.go | 0 .../modules/k6/experimental/fs/errors_gen.go | 0 .../js}/modules/k6/experimental/fs/file.go | 0 .../modules/k6/experimental/fs/file_test.go | 0 .../js}/modules/k6/experimental/fs/module.go | 0 .../modules/k6/experimental/fs/module_test.go | 2 +- .../modules/k6/experimental/streams/errors.go | 0 .../k6/experimental/streams/errors_gen.go | 0 .../modules/k6/experimental/streams/goja.go | 0 .../modules/k6/experimental/streams/module.go | 0 .../k6/experimental/streams/module_test.go | 0 .../modules/k6/experimental/streams/queue.go | 0 .../streams/readable_stream_controller.go | 0 .../readable_stream_default_controller.go | 0 .../streams/readable_stream_default_reader.go | 0 .../streams/readable_stream_reader.go | 0 .../experimental/streams/readable_streams.go | 0 .../streams/readable_streams_test.go | 0 .../k6/experimental/streams/tests/README.md | 0 .../k6/experimental/streams/tests/checkout.sh | 0 .../tests/reentrant-strategies.any.js.patch | 0 .../streams/tests/rs-test-templates.js.patch | 0 .../streams/tests/testharness.js.patch | 0 .../experimental/streams/underlying_source.go | 0 .../websockets/autobahn_tests/README.md | 0 .../autobahn_tests/config/fuzzingserver.json | 0 .../autobahn_tests/reports/.gitkeep | 0 .../websockets/autobahn_tests/script.js | 0 .../k6/experimental/websockets/blob.go | 2 +- .../k6/experimental/websockets/blob_test.go | 0 .../experimental/websockets/events/events.go | 0 .../k6/experimental/websockets/helpers.go | 0 .../k6/experimental/websockets/listeners.go | 2 +- .../k6/experimental/websockets/main_test.go | 0 .../k6/experimental/websockets/params.go | 0 .../k6/experimental/websockets/websockets.go | 2 +- .../websockets/websockets_test.go | 4 +-- {js => internal/js}/modules/k6/grpc/client.go | 2 +- .../js}/modules/k6/grpc/client_test.go | 12 +++---- {js => internal/js}/modules/k6/grpc/grpc.go | 0 .../js}/modules/k6/grpc/helpers_test.go | 0 .../js}/modules/k6/grpc/listeners.go | 0 .../js}/modules/k6/grpc/metrics.go | 0 {js => internal/js}/modules/k6/grpc/params.go | 0 .../js}/modules/k6/grpc/params_test.go | 0 {js => internal/js}/modules/k6/grpc/stream.go | 2 +- .../js}/modules/k6/grpc/stream_test.go | 4 +-- .../js}/modules/k6/grpc/teststate_test.go | 6 ++-- .../js}/modules/k6/html/gen/gen_elements.go | 0 .../js}/modules/k6/metrics/metrics.go | 0 .../js}/modules/k6/metrics/metrics_test.go | 2 +- .../js}/modules/k6/timers/timers.go | 0 .../js}/modules/k6/timers/timers_test.go | 2 +- .../js}/modules/k6/webcrypto/aes.go | 0 .../js}/modules/k6/webcrypto/algorithm.go | 0 .../js}/modules/k6/webcrypto/base64.go | 0 .../js}/modules/k6/webcrypto/bits.go | 0 .../js}/modules/k6/webcrypto/cmd_run_test.go | 6 ++-- .../js}/modules/k6/webcrypto/crypto.go | 0 .../modules/k6/webcrypto/elliptic_curve.go | 0 .../js}/modules/k6/webcrypto/encryption.go | 0 .../js}/modules/k6/webcrypto/errors.go | 0 .../js}/modules/k6/webcrypto/hash.go | 0 .../js}/modules/k6/webcrypto/hmac.go | 0 .../js}/modules/k6/webcrypto/jwk.go | 0 .../js}/modules/k6/webcrypto/key.go | 0 .../js}/modules/k6/webcrypto/module.go | 0 .../js}/modules/k6/webcrypto/params.go | 0 .../js}/modules/k6/webcrypto/rsa.go | 0 .../js}/modules/k6/webcrypto/signer.go | 0 .../js}/modules/k6/webcrypto/sobek.go | 0 .../js}/modules/k6/webcrypto/sobek_test.go | 0 .../js}/modules/k6/webcrypto/subtle_crypto.go | 0 .../js}/modules/k6/webcrypto/tests/README.md | 0 .../modules/k6/webcrypto/tests/checkout.sh | 0 .../modules/k6/webcrypto/tests/crypto_test.go | 0 .../k6/webcrypto/tests/generate-patches.sh | 0 .../k6/webcrypto/tests/subtle_crypto_test.go | 0 .../k6/webcrypto/tests/test_setup_test.go | 6 ++-- .../k6/webcrypto/tests/util/helpers.js | 0 ...oAPI__derive_bits_keys__ecdh_bits.js.patch | 0 ..._encrypt_decrypt__aes_gcm_vectors.js.patch | 0 ...bCryptoAPI__generateKey__failures.js.patch | 0 ...CryptoAPI__generateKey__successes.js.patch | 0 ...rt_export__ec_importKey.https.any.js.patch | 0 ...t_export__rsa_importKey.https.any.js.patch | 0 ...rt__symmetric_importKey.https.any.js.patch | 0 ...toAPI__sign_verify__ecdsa_vectors.js.patch | 0 .../WebCryptoAPI__sign_verify__rsa.js.patch | 0 .../js}/modules/k6/webcrypto/types.go | 0 {js => internal/js}/modules/k6/ws/ws.go | 0 {js => internal/js}/modules/k6/ws/ws_test.go | 4 +-- {js => internal/js}/modules_vu.go | 4 +-- {js => internal/js}/path_resolution_test.go | 2 +- {js => internal/js}/runner.go | 6 ++-- {js => internal/js}/runner_test.go | 16 +++++----- {js => internal/js}/share_test.go | 2 +- {js => internal/js}/summary-wrapper.js | 0 {js => internal/js}/summary.go | 0 {js => internal/js}/summary.js | 0 {js => internal/js}/summary_test.go | 2 +- {js => internal/js}/tc39/README.md | 0 ...ing_test_errors-experimental_enhanced.json | 0 .../tc39/breaking_test_errors-extended.json | 0 {js => internal/js}/tc39/checkout.sh | 0 {js => internal/js}/tc39/tc39_norace_test.go | 0 {js => internal/js}/tc39/tc39_race_test.go | 0 {js => internal/js}/tc39/tc39_test.go | 8 ++--- {js => internal/js}/timeout_error.go | 0 {js => internal/js}/timeout_error_test.go | 0 {lib => internal/lib}/netext/grpcext/conn.go | 0 .../lib}/netext/grpcext/conn_test.go | 0 .../lib}/netext/grpcext/reflect.go | 0 .../lib}/netext/grpcext/stream.go | 0 {lib => internal/lib}/strvals/doc.go | 0 {lib => internal/lib}/strvals/parser.go | 0 {lib => internal/lib}/strvals/parser_test.go | 0 {lib => internal/lib}/testutils/fs.go | 0 .../testutils/grpcservice/route_guide.pb.go | 0 .../testutils/grpcservice/route_guide.proto | 0 .../grpcservice/route_guide_grpc.pb.go | 0 .../lib}/testutils/grpcservice/service.go | 0 .../grpc_any_testing/any_test.pb.go | 0 .../grpc_any_testing/any_test.proto | 0 .../grpc_protoset_testing/test.protoset | Bin .../grpc_protoset_testing/test_message.proto | 0 .../grpc_protoset_testing/test_service.proto | 0 .../grpc_testing/nested_types.proto | 0 .../httpmultibin/grpc_testing/test.pb.go | 0 .../httpmultibin/grpc_testing/test.proto | 0 .../httpmultibin/grpc_testing/test_grpc.pb.go | 0 .../grpc_wrappers_testing/service.go | 0 .../grpc_wrappers_testing/test.pb.go | 0 .../grpc_wrappers_testing/test.proto | 0 .../grpc_wrappers_testing/test_grpc.pb.go | 0 .../testutils/httpmultibin/httpmultibin.go | 4 +-- .../nested_types/nested_types.proto | 0 .../lib}/testutils/logrus_hook.go | 0 .../lib}/testutils/minirunner/minirunner.go | 0 .../lib}/testutils/mockoutput/mockoutput.go | 0 .../lib}/testutils/mockresolver/resolver.go | 0 .../lib}/testutils/test_output.go | 0 {lib => internal/lib}/testutils/untar.go | 0 {lib => internal/lib}/trace/doc.go | 0 {lib => internal/lib}/trace/otel.go | 2 +- {lib => internal/lib}/trace/otel_test.go | 0 {loader => internal/loader}/filesystems.go | 0 {loader => internal/loader}/loader.go | 0 {loader => internal/loader}/loader_test.go | 6 ++-- {loader => internal/loader}/readsource.go | 0 .../loader}/readsource_test.go | 2 +- {log => internal/log}/file.go | 2 +- {log => internal/log}/file_test.go | 0 {log => internal/log}/levels.go | 0 {log => internal/log}/levels_test.go | 0 {log => internal/log}/log.go | 0 {log => internal/log}/loki.go | 2 +- {log => internal/log}/loki_test.go | 0 .../metrics}/engine/engine.go | 0 .../metrics}/engine/engine_test.go | 2 +- .../metrics}/engine/ingester.go | 0 .../metrics}/engine/ingester_test.go | 2 +- .../expv2/integration/integration_test.go | 4 +-- .../expv2/integration/testdata/metricset.json | 0 .../output}/cloud/expv2/pbcloud/gen.go | 0 .../output}/cloud/expv2/pbcloud/metric.pb.go | 0 .../output}/cloud/expv2/pbcloud/metric.proto | 0 .../output}/cloud/insights/collect.go | 2 +- .../output}/cloud/insights/collect_test.go | 2 +- .../output}/cloud/insights/doc.go | 0 .../output}/cloud/insights/enable.go | 0 .../output}/cloud/insights/flush.go | 2 +- .../output}/cloud/insights/flush_test.go | 2 +- {output => internal/output}/cloud/output.go | 2 +- .../output}/cloud/output_test.go | 4 +-- .../output}/influxdb/bench_test.go | 0 .../output}/influxdb/config.go | 0 .../output}/influxdb/config_test.go | 0 .../output}/influxdb/output.go | 0 .../output}/influxdb/output_test.go | 2 +- {output => internal/output}/influxdb/util.go | 0 .../output}/influxdb/util_test.go | 0 .../output}/json/benchmark_test.go | 2 +- {output => internal/output}/json/json.go | 0 .../output}/json/json_easyjson.go | 0 {output => internal/output}/json/json_test.go | 2 +- {output => internal/output}/json/wrapper.go | 0 {ui => internal/ui}/console/doc.go | 0 {ui => internal/ui}/console/writer.go | 0 {ui => internal/ui}/doc.go | 0 {ui => internal/ui}/form.go | 0 {ui => internal/ui}/form_fields.go | 0 {ui => internal/ui}/form_fields_test.go | 0 {ui => internal/ui}/form_test.go | 0 {ui => internal/ui}/pb/doc.go | 0 {ui => internal/ui}/pb/helpers.go | 0 {ui => internal/ui}/pb/helpers_test.go | 0 {ui => internal/ui}/pb/progressbar.go | 0 {ui => internal/ui}/pb/progressbar_test.go | 0 {usage => internal/usage}/usage.go | 0 {usage => internal/usage}/usage_test.go | 0 js/common/event.go | 2 +- js/modules/k6/http/request_test.go | 4 +-- js/modules/k6/marshalling_test.go | 10 +++--- js/modules/require_impl.go | 4 +-- js/modules/resolution.go | 6 ++-- js/modulestest/runtime.go | 10 +++--- lib/archive.go | 2 +- lib/archive_test.go | 2 +- lib/executor/base_executor.go | 2 +- lib/executor/common_test.go | 4 +-- lib/executor/constant_arrival_rate.go | 2 +- lib/executor/constant_vus.go | 2 +- lib/executor/execution_test.go | 4 +-- lib/executor/executors_test.go | 2 +- lib/executor/externally_controlled.go | 2 +- lib/executor/helpers.go | 4 +-- lib/executor/per_vu_iterations.go | 2 +- lib/executor/ramping_arrival_rate.go | 2 +- lib/executor/ramping_vus.go | 2 +- lib/executor/shared_iterations.go | 2 +- lib/executor/vu_handle_test.go | 4 +-- lib/executors.go | 2 +- lib/netext/dialer_test.go | 2 +- lib/netext/httpext/error_codes_test.go | 2 +- lib/netext/resolver_test.go | 2 +- lib/old_archive_test.go | 2 +- lib/test_state.go | 6 ++-- lib/vu_state.go | 2 +- output/cloud/expv2/flush.go | 2 +- output/cloud/expv2/flush_test.go | 4 +-- output/cloud/expv2/hdr.go | 2 +- output/cloud/expv2/hdr_test.go | 2 +- output/cloud/expv2/mapping.go | 2 +- output/cloud/expv2/metrics_client.go | 2 +- output/cloud/expv2/metrics_client_test.go | 2 +- output/cloud/expv2/output.go | 4 +-- output/cloud/expv2/output_test.go | 2 +- output/csv/output_test.go | 2 +- output/types.go | 2 +- 584 files changed, 501 insertions(+), 474 deletions(-) create mode 100644 cmd/execute.go create mode 100644 cmd/tests/global_state.go rename {api => internal/api}/server.go (97%) rename {api => internal/api}/server_test.go (98%) rename {cloudapi => internal/cloudapi}/insights/client.go (99%) rename {cloudapi => internal/cloudapi}/insights/client_test.go (99%) rename {cloudapi => internal/cloudapi}/insights/doc.go (100%) rename {cloudapi => internal/cloudapi}/insights/domain.go (100%) rename {cloudapi => internal/cloudapi}/insights/mappers.go (93%) rename {cloudapi => internal/cloudapi}/insights/mappers_test.go (94%) rename {cloudapi => internal/cloudapi}/insights/proto/gen.go (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/common/common.pb.go (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/common/common.proto (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/ingester/ingester.pb.go (99%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/ingester/ingester.proto (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/ingester/ingester_grpc.pb.go (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/k6/labels.pb.go (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/k6/labels.proto (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/k6/request_metadata.pb.go (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/k6/request_metadata.proto (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/trace/labels.pb.go (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/trace/labels.proto (100%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/trace/span.pb.go (99%) rename {cloudapi => internal/cloudapi}/insights/proto/v1/trace/span.proto (100%) rename {cmd => internal/cmd}/archive.go (100%) rename {cmd => internal/cmd}/archive_test.go (99%) rename {cmd => internal/cmd}/builtin_output_gen.go (100%) rename {cmd => internal/cmd}/cloud.go (99%) rename {cmd => internal/cmd}/cloud_login.go (99%) rename {cmd => internal/cmd}/cloud_run.go (98%) rename {cmd => internal/cmd}/cloud_upload.go (100%) rename {cmd => internal/cmd}/common.go (100%) rename {cmd => internal/cmd}/config.go (100%) rename {cmd => internal/cmd}/config_consolidation_test.go (99%) rename {cmd => internal/cmd}/config_test.go (100%) rename {cmd => internal/cmd}/doc.go (100%) rename {cmd => internal/cmd}/inspect.go (100%) rename {cmd => internal/cmd}/login.go (100%) rename {cmd => internal/cmd}/login_cloud.go (99%) rename {cmd => internal/cmd}/login_influxdb.go (97%) rename {cmd => internal/cmd}/new.go (98%) rename {cmd => internal/cmd}/new_test.go (98%) rename {cmd => internal/cmd}/options.go (100%) rename {cmd => internal/cmd}/options_test.go (100%) rename {cmd => internal/cmd}/outputs.go (98%) rename {cmd => internal/cmd}/outputs_cloud.go (100%) rename {cmd => internal/cmd}/outputs_test.go (100%) rename {cmd => internal/cmd}/pause.go (100%) rename {cmd => internal/cmd}/report.go (97%) rename {cmd => internal/cmd}/report_test.go (95%) rename {cmd => internal/cmd}/resume.go (100%) rename {cmd => internal/cmd}/root.go (99%) rename {cmd => internal/cmd}/root_test.go (98%) rename {cmd => internal/cmd}/run.go (98%) rename {cmd => internal/cmd}/run_test.go (99%) rename {cmd => internal/cmd}/runtime_options.go (100%) rename {cmd => internal/cmd}/runtime_options_test.go (99%) rename {cmd => internal/cmd}/scale.go (100%) rename {cmd => internal/cmd}/stats.go (100%) rename {cmd => internal/cmd}/status.go (100%) rename {cmd => internal/cmd}/stdlog_integration_test.go (92%) rename {cmd => internal/cmd}/templates/browser.js (100%) rename {cmd => internal/cmd}/templates/minimal.js (100%) rename {cmd => internal/cmd}/templates/protocol.js (100%) rename {cmd => internal/cmd}/templates/templates.go (100%) rename {cmd => internal/cmd}/test_load.go (99%) rename {cmd => internal/cmd}/testdata/abort.js (100%) rename {cmd => internal/cmd}/testdata/abort_initerr.js (100%) rename {cmd => internal/cmd}/testdata/abort_initvu.js (100%) rename {cmd => internal/cmd}/testdata/abort_teardown.js (100%) rename {cmd => internal/cmd}/testdata/example.har (100%) rename {cmd => internal/cmd}/testdata/example.js (100%) rename {cmd => internal/cmd}/testdata/initerr.js (100%) rename {cmd => internal/cmd}/testdata/invalidconfig/invalid.json (100%) rename {cmd => internal/cmd}/testdata/invalidconfig/invalid_option.js (100%) rename {cmd => internal/cmd}/testdata/invalidconfig/invalid_scenario.js (100%) rename {cmd => internal/cmd}/testdata/invalidconfig/option_env.js (100%) rename {cmd => internal/cmd}/testdata/thresholds/empty_sink_no_nan.js (100%) rename {cmd => internal/cmd}/testdata/thresholds/malformed_expression.js (100%) rename {cmd => internal/cmd}/testdata/thresholds/name_contains_tokens.js (100%) rename {cmd => internal/cmd}/testdata/thresholds/non_existing_metric.js (100%) rename {cmd => internal/cmd}/testdata/thresholds/thresholds_on_submetric_without_samples.js (100%) rename {cmd => internal/cmd}/testdata/thresholds/unsupported_aggregation_method.js (100%) rename {cmd => internal/cmd}/tests/cmd_cloud_run_test.go (99%) rename {cmd => internal/cmd}/tests/cmd_cloud_test.go (99%) rename {cmd => internal/cmd}/tests/cmd_cloud_upload_test.go (98%) rename {cmd => internal/cmd}/tests/cmd_run_grpc_test.go (94%) rename {cmd => internal/cmd}/tests/cmd_run_test.go (99%) rename {cmd => internal/cmd}/tests/doc.go (100%) rename {cmd => internal/cmd}/tests/eventloop_test.go (99%) rename {cmd => internal/cmd}/tests/events/events.go (98%) rename {cmd => internal/cmd}/tests/grpc.go (94%) rename {cmd => internal/cmd}/tests/test_state.go (96%) rename {cmd => internal/cmd}/tests/testdata/archives/archive_v0.42.0_linux.tar (100%) rename {cmd => internal/cmd}/tests/testdata/archives/archive_v0.42.0_windows.tar (100%) rename {cmd => internal/cmd}/tests/testdata/archives/archive_v0.46.0_with_loadimpact_option.tar (100%) rename {cmd => internal/cmd}/tests/tests.go (100%) rename {cmd => internal/cmd}/tests/tests_test.go (96%) rename {cmd => internal/cmd}/ui.go (99%) rename {cmd => internal/cmd}/ui_test.go (98%) rename {cmd => internal/cmd}/ui_unix.go (100%) rename {cmd => internal/cmd}/ui_windows.go (100%) rename {cmd => internal/cmd}/version.go (100%) rename {cmd => internal/cmd}/version_test.go (98%) rename {event => internal/event}/doc.go (100%) rename {event => internal/event}/event.go (100%) rename {event => internal/event}/system.go (100%) rename {event => internal/event}/system_test.go (100%) rename {event => internal/event}/type.go (100%) rename {event => internal/event}/type_gen.go (100%) rename {execution => internal/execution}/abort.go (100%) rename {execution => internal/execution}/controller.go (100%) rename {execution => internal/execution}/local/controller.go (100%) rename {execution => internal/execution}/pkg.go (100%) rename {execution => internal/execution}/scheduler.go (99%) rename {execution => internal/execution}/scheduler_ext_exec_test.go (98%) rename {execution => internal/execution}/scheduler_ext_test.go (99%) rename {execution => internal/execution}/scheduler_int_test.go (95%) rename {js => internal/js}/bundle.go (99%) rename {js => internal/js}/bundle_test.go (99%) rename {js => internal/js}/compiler/compiler.go (99%) rename {js => internal/js}/compiler/compiler_test.go (99%) rename {js => internal/js}/compiler/enhanced.go (100%) rename {js => internal/js}/compiler/enhanced_test.go (98%) rename {js => internal/js}/console.go (100%) rename {js => internal/js}/console_test.go (99%) rename {js => internal/js}/doc.go (100%) rename {js => internal/js}/empty_iterations_bench_test.go (100%) rename {js => internal/js}/esm_vs_commonjs_test.go (100%) rename {js => internal/js}/eventloop/eventloop.go (100%) rename {js => internal/js}/eventloop/eventloop_test.go (95%) rename {js => internal/js}/http_bench_test.go (97%) rename {js => internal/js}/init_and_modules_test.go (96%) rename {js => internal/js}/initcontext.go (98%) rename {js => internal/js}/initcontext_test.go (100%) rename {js => internal/js}/jsmodules.go (81%) rename {js => internal/js}/module_loading_test.go (99%) rename {js => internal/js}/modules/k6/browser/browser/browser_context_mapping.go (97%) rename {js => internal/js}/modules/k6/browser/browser/browser_context_options_test.go (97%) rename {js => internal/js}/modules/k6/browser/browser/browser_mapping.go (96%) rename {js => internal/js}/modules/k6/browser/browser/console_message_mapping.go (92%) rename {js => internal/js}/modules/k6/browser/browser/element_handle_mapping.go (98%) rename {js => internal/js}/modules/k6/browser/browser/file_persister.go (96%) rename {js => internal/js}/modules/k6/browser/browser/file_persister_test.go (97%) rename {js => internal/js}/modules/k6/browser/browser/frame_mapping.go (99%) rename {js => internal/js}/modules/k6/browser/browser/helpers.go (94%) rename {js => internal/js}/modules/k6/browser/browser/helpers_test.go (100%) rename {js => internal/js}/modules/k6/browser/browser/js_handle_mapping.go (94%) rename {js => internal/js}/modules/k6/browser/browser/keyboard_mapping.go (92%) rename {js => internal/js}/modules/k6/browser/browser/locator_mapping.go (98%) rename {js => internal/js}/modules/k6/browser/browser/mapping.go (95%) rename {js => internal/js}/modules/k6/browser/browser/mapping_test.go (99%) rename {js => internal/js}/modules/k6/browser/browser/metric_event_mapping.go (91%) rename {js => internal/js}/modules/k6/browser/browser/module.go (96%) rename {js => internal/js}/modules/k6/browser/browser/module_test.go (92%) rename {js => internal/js}/modules/k6/browser/browser/modulevu.go (89%) rename {js => internal/js}/modules/k6/browser/browser/mouse_mapping.go (91%) rename {js => internal/js}/modules/k6/browser/browser/page_mapping.go (99%) rename {js => internal/js}/modules/k6/browser/browser/registry.go (97%) rename {js => internal/js}/modules/k6/browser/browser/registry_test.go (98%) rename {js => internal/js}/modules/k6/browser/browser/request_mapping.go (93%) rename {js => internal/js}/modules/k6/browser/browser/response_mapping.go (95%) rename {js => internal/js}/modules/k6/browser/browser/touchscreen_mapping.go (77%) rename {js => internal/js}/modules/k6/browser/browser/worker_mapping.go (74%) rename {js => internal/js}/modules/k6/browser/chromium/browser.go (85%) rename {js => internal/js}/modules/k6/browser/chromium/browser_type.go (98%) rename {js => internal/js}/modules/k6/browser/chromium/browser_type_test.go (98%) rename {js => internal/js}/modules/k6/browser/common/barrier.go (100%) rename {js => internal/js}/modules/k6/browser/common/barrier_test.go (92%) rename {js => internal/js}/modules/k6/browser/common/browser.go (99%) rename {js => internal/js}/modules/k6/browser/common/browser_context.go (99%) rename {js => internal/js}/modules/k6/browser/common/browser_context_options.go (100%) rename {js => internal/js}/modules/k6/browser/common/browser_context_test.go (96%) rename {js => internal/js}/modules/k6/browser/common/browser_options.go (97%) rename {js => internal/js}/modules/k6/browser/common/browser_options_test.go (97%) rename {js => internal/js}/modules/k6/browser/common/browser_process.go (98%) rename {js => internal/js}/modules/k6/browser/common/browser_process_meta.go (97%) rename {js => internal/js}/modules/k6/browser/common/browser_process_test.go (100%) rename {js => internal/js}/modules/k6/browser/common/browser_test.go (97%) rename {js => internal/js}/modules/k6/browser/common/connection.go (99%) rename {js => internal/js}/modules/k6/browser/common/connection_test.go (97%) rename {js => internal/js}/modules/k6/browser/common/consts.go (100%) rename {js => internal/js}/modules/k6/browser/common/context.go (100%) rename {js => internal/js}/modules/k6/browser/common/context_test.go (100%) rename {js => internal/js}/modules/k6/browser/common/device.go (100%) rename {js => internal/js}/modules/k6/browser/common/doc.go (100%) rename {js => internal/js}/modules/k6/browser/common/element_handle.go (99%) rename {js => internal/js}/modules/k6/browser/common/element_handle_options.go (99%) rename {js => internal/js}/modules/k6/browser/common/element_handle_test.go (98%) rename {js => internal/js}/modules/k6/browser/common/errors.go (100%) rename {js => internal/js}/modules/k6/browser/common/event_emitter.go (100%) rename {js => internal/js}/modules/k6/browser/common/event_emitter_test.go (100%) rename {js => internal/js}/modules/k6/browser/common/execution_context.go (98%) rename {js => internal/js}/modules/k6/browser/common/frame.go (99%) rename {js => internal/js}/modules/k6/browser/common/frame_manager.go (99%) rename {js => internal/js}/modules/k6/browser/common/frame_options.go (99%) rename {js => internal/js}/modules/k6/browser/common/frame_options_test.go (98%) rename {js => internal/js}/modules/k6/browser/common/frame_session.go (99%) rename {js => internal/js}/modules/k6/browser/common/frame_test.go (96%) rename {js => internal/js}/modules/k6/browser/common/helpers.go (99%) rename {js => internal/js}/modules/k6/browser/common/helpers_test.go (99%) rename {js => internal/js}/modules/k6/browser/common/hooks.go (100%) rename {js => internal/js}/modules/k6/browser/common/http.go (99%) rename {js => internal/js}/modules/k6/browser/common/http_test.go (98%) rename {js => internal/js}/modules/k6/browser/common/js/actions.go (100%) rename {js => internal/js}/modules/k6/browser/common/js/doc.go (100%) rename {js => internal/js}/modules/k6/browser/common/js/embedded_scripts.go (100%) rename {js => internal/js}/modules/k6/browser/common/js/injected_script.js (100%) rename {js => internal/js}/modules/k6/browser/common/js/query_all.js (100%) rename {js => internal/js}/modules/k6/browser/common/js/scroll_into_view.js (100%) rename {js => internal/js}/modules/k6/browser/common/js/selectors.go (100%) rename {js => internal/js}/modules/k6/browser/common/js/web_vital_iife.js (100%) rename {js => internal/js}/modules/k6/browser/common/js/web_vital_init.js (100%) rename {js => internal/js}/modules/k6/browser/common/js_handle.go (99%) rename {js => internal/js}/modules/k6/browser/common/keyboard.go (99%) rename {js => internal/js}/modules/k6/browser/common/keyboard_test.go (98%) rename {js => internal/js}/modules/k6/browser/common/kill_linux.go (100%) rename {js => internal/js}/modules/k6/browser/common/kill_other.go (100%) rename {js => internal/js}/modules/k6/browser/common/layout.go (98%) rename {js => internal/js}/modules/k6/browser/common/layout_test.go (100%) rename {js => internal/js}/modules/k6/browser/common/lifecycle.go (100%) rename {js => internal/js}/modules/k6/browser/common/lifecycle_test.go (100%) rename {js => internal/js}/modules/k6/browser/common/locator.go (99%) rename {js => internal/js}/modules/k6/browser/common/mouse.go (100%) rename {js => internal/js}/modules/k6/browser/common/mouse_options.go (98%) rename {js => internal/js}/modules/k6/browser/common/network_manager.go (99%) rename {js => internal/js}/modules/k6/browser/common/network_manager_test.go (97%) rename {js => internal/js}/modules/k6/browser/common/network_profile.go (100%) rename {js => internal/js}/modules/k6/browser/common/page.go (99%) rename {js => internal/js}/modules/k6/browser/common/page_options.go (98%) rename {js => internal/js}/modules/k6/browser/common/page_test.go (100%) rename {js => internal/js}/modules/k6/browser/common/remote_object.go (99%) rename {js => internal/js}/modules/k6/browser/common/remote_object_test.go (99%) rename {js => internal/js}/modules/k6/browser/common/screenshotter.go (99%) rename {js => internal/js}/modules/k6/browser/common/selectors.go (100%) rename {js => internal/js}/modules/k6/browser/common/session.go (99%) rename {js => internal/js}/modules/k6/browser/common/session_test.go (96%) rename {js => internal/js}/modules/k6/browser/common/timeout.go (100%) rename {js => internal/js}/modules/k6/browser/common/timeout_test.go (100%) rename {js => internal/js}/modules/k6/browser/common/touchscreen.go (100%) rename {js => internal/js}/modules/k6/browser/common/trace.go (97%) rename {js => internal/js}/modules/k6/browser/common/worker.go (100%) rename {js => internal/js}/modules/k6/browser/env/env.go (100%) rename {js => internal/js}/modules/k6/browser/k6error/internal.go (100%) rename {js => internal/js}/modules/k6/browser/k6ext/context.go (100%) rename {js => internal/js}/modules/k6/browser/k6ext/doc.go (100%) rename {js => internal/js}/modules/k6/browser/k6ext/k6test/doc.go (100%) rename {js => internal/js}/modules/k6/browser/k6ext/k6test/executor.go (100%) rename {js => internal/js}/modules/k6/browser/k6ext/k6test/vu.go (96%) rename {js => internal/js}/modules/k6/browser/k6ext/metrics.go (100%) rename {js => internal/js}/modules/k6/browser/k6ext/panic.go (100%) rename {js => internal/js}/modules/k6/browser/k6ext/promise.go (100%) rename {js => internal/js}/modules/k6/browser/keyboardlayout/layout.go (100%) rename {js => internal/js}/modules/k6/browser/keyboardlayout/us.go (100%) rename {js => internal/js}/modules/k6/browser/log/logger.go (100%) rename {js => internal/js}/modules/k6/browser/storage/file_persister.go (100%) rename {js => internal/js}/modules/k6/browser/storage/file_persister_test.go (100%) rename {js => internal/js}/modules/k6/browser/storage/storage.go (100%) rename {js => internal/js}/modules/k6/browser/storage/storage_test.go (100%) rename {js => internal/js}/modules/k6/browser/tests/browser_context_options_test.go (98%) rename {js => internal/js}/modules/k6/browser/tests/browser_context_test.go (99%) rename {js => internal/js}/modules/k6/browser/tests/browser_test.go (97%) rename {js => internal/js}/modules/k6/browser/tests/browser_type_test.go (87%) rename {js => internal/js}/modules/k6/browser/tests/doc.go (100%) rename {js => internal/js}/modules/k6/browser/tests/element_handle_test.go (99%) rename {js => internal/js}/modules/k6/browser/tests/frame_manager_test.go (98%) rename {js => internal/js}/modules/k6/browser/tests/frame_test.go (98%) rename {js => internal/js}/modules/k6/browser/tests/helpers.go (91%) rename {js => internal/js}/modules/k6/browser/tests/js_handle_get_properties_test.go (100%) rename {js => internal/js}/modules/k6/browser/tests/js_handle_test.go (100%) rename {js => internal/js}/modules/k6/browser/tests/keyboard_test.go (98%) rename {js => internal/js}/modules/k6/browser/tests/launch_options_slowmo_test.go (99%) rename {js => internal/js}/modules/k6/browser/tests/lifecycle_wait_test.go (99%) rename {js => internal/js}/modules/k6/browser/tests/locator_test.go (99%) rename {js => internal/js}/modules/k6/browser/tests/logrus_hook.go (100%) rename {js => internal/js}/modules/k6/browser/tests/mouse_test.go (100%) rename {js => internal/js}/modules/k6/browser/tests/network_manager_test.go (99%) rename {js => internal/js}/modules/k6/browser/tests/page_test.go (99%) rename {js => internal/js}/modules/k6/browser/tests/remote_obj_test.go (98%) rename {js => internal/js}/modules/k6/browser/tests/setinputfiles_test.go (99%) rename {js => internal/js}/modules/k6/browser/tests/static/concealed_link.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/dialog.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/embedded_iframe.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/iframe_home.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/iframe_signin.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/iframe_test_main.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/iframe_test_nested1.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/iframe_test_nested2.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/lifecycle.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/lifecycle_main_frame.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/lifecycle_no_ping_js.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/locators.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/mouse_helper.js (100%) rename {js => internal/js}/modules/k6/browser/tests/static/nav_in_doc.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/non_clickable.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/page1.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/page2.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/ping.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/select_options.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/shadow_and_doc_frag.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/shadow_dom_link.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/usual.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/visible.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/wait_for.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/wait_until.html (100%) rename {js => internal/js}/modules/k6/browser/tests/static/web_vitals.html (100%) rename {js => internal/js}/modules/k6/browser/tests/test_browser.go (96%) rename {js => internal/js}/modules/k6/browser/tests/test_browser_proxy.go (100%) rename {js => internal/js}/modules/k6/browser/tests/test_browser_test.go (96%) rename {js => internal/js}/modules/k6/browser/tests/tracing_test.go (98%) rename {js => internal/js}/modules/k6/browser/tests/webvital_test.go (98%) rename {js => internal/js}/modules/k6/browser/tests/ws/server.go (100%) rename {js => internal/js}/modules/k6/browser/trace/trace.go (100%) rename {js => internal/js}/modules/k6/crypto/crypto.go (100%) rename {js => internal/js}/modules/k6/crypto/crypto_test.go (100%) rename {js => internal/js}/modules/k6/crypto/x509/x509.go (100%) rename {js => internal/js}/modules/k6/crypto/x509/x509_test.go (100%) rename {js => internal/js}/modules/k6/data/data.go (100%) rename {js => internal/js}/modules/k6/data/share.go (100%) rename {js => internal/js}/modules/k6/data/share_test.go (99%) rename {js => internal/js}/modules/k6/encoding/encoding.go (100%) rename {js => internal/js}/modules/k6/encoding/encoding_test.go (100%) rename {js => internal/js}/modules/k6/execution/execution.go (100%) rename {js => internal/js}/modules/k6/execution/execution_test.go (99%) rename {js => internal/js}/modules/k6/experimental/README.md (100%) rename {js => internal/js}/modules/k6/experimental/csv/module.go (98%) rename {js => internal/js}/modules/k6/experimental/csv/module_test.go (99%) rename {js => internal/js}/modules/k6/experimental/csv/reader.go (100%) rename {js => internal/js}/modules/k6/experimental/csv/reader_test.go (100%) rename {js => internal/js}/modules/k6/experimental/experimental.go (100%) rename {js => internal/js}/modules/k6/experimental/fs/cache.go (100%) rename {js => internal/js}/modules/k6/experimental/fs/cache_test.go (100%) rename {js => internal/js}/modules/k6/experimental/fs/errors.go (100%) rename {js => internal/js}/modules/k6/experimental/fs/errors_gen.go (100%) rename {js => internal/js}/modules/k6/experimental/fs/file.go (100%) rename {js => internal/js}/modules/k6/experimental/fs/file_test.go (100%) rename {js => internal/js}/modules/k6/experimental/fs/module.go (100%) rename {js => internal/js}/modules/k6/experimental/fs/module_test.go (99%) rename {js => internal/js}/modules/k6/experimental/streams/errors.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/errors_gen.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/goja.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/module.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/module_test.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/queue.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/readable_stream_controller.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/readable_stream_default_controller.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/readable_stream_default_reader.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/readable_stream_reader.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/readable_streams.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/readable_streams_test.go (100%) rename {js => internal/js}/modules/k6/experimental/streams/tests/README.md (100%) rename {js => internal/js}/modules/k6/experimental/streams/tests/checkout.sh (100%) rename {js => internal/js}/modules/k6/experimental/streams/tests/reentrant-strategies.any.js.patch (100%) rename {js => internal/js}/modules/k6/experimental/streams/tests/rs-test-templates.js.patch (100%) rename {js => internal/js}/modules/k6/experimental/streams/tests/testharness.js.patch (100%) rename {js => internal/js}/modules/k6/experimental/streams/underlying_source.go (100%) rename {js => internal/js}/modules/k6/experimental/websockets/autobahn_tests/README.md (100%) rename {js => internal/js}/modules/k6/experimental/websockets/autobahn_tests/config/fuzzingserver.json (100%) rename {js => internal/js}/modules/k6/experimental/websockets/autobahn_tests/reports/.gitkeep (100%) rename {js => internal/js}/modules/k6/experimental/websockets/autobahn_tests/script.js (100%) rename {js => internal/js}/modules/k6/experimental/websockets/blob.go (98%) rename {js => internal/js}/modules/k6/experimental/websockets/blob_test.go (100%) rename {js => internal/js}/modules/k6/experimental/websockets/events/events.go (100%) rename {js => internal/js}/modules/k6/experimental/websockets/helpers.go (100%) rename {js => internal/js}/modules/k6/experimental/websockets/listeners.go (97%) rename {js => internal/js}/modules/k6/experimental/websockets/main_test.go (100%) rename {js => internal/js}/modules/k6/experimental/websockets/params.go (100%) rename {js => internal/js}/modules/k6/experimental/websockets/websockets.go (99%) rename {js => internal/js}/modules/k6/experimental/websockets/websockets_test.go (99%) rename {js => internal/js}/modules/k6/grpc/client.go (99%) rename {js => internal/js}/modules/k6/grpc/client_test.go (99%) rename {js => internal/js}/modules/k6/grpc/grpc.go (100%) rename {js => internal/js}/modules/k6/grpc/helpers_test.go (100%) rename {js => internal/js}/modules/k6/grpc/listeners.go (100%) rename {js => internal/js}/modules/k6/grpc/metrics.go (100%) rename {js => internal/js}/modules/k6/grpc/params.go (100%) rename {js => internal/js}/modules/k6/grpc/params_test.go (100%) rename {js => internal/js}/modules/k6/grpc/stream.go (99%) rename {js => internal/js}/modules/k6/grpc/stream_test.go (99%) rename {js => internal/js}/modules/k6/grpc/teststate_test.go (96%) rename {js => internal/js}/modules/k6/html/gen/gen_elements.go (100%) rename {js => internal/js}/modules/k6/metrics/metrics.go (100%) rename {js => internal/js}/modules/k6/metrics/metrics_test.go (99%) rename {js => internal/js}/modules/k6/timers/timers.go (100%) rename {js => internal/js}/modules/k6/timers/timers_test.go (99%) rename {js => internal/js}/modules/k6/webcrypto/aes.go (100%) rename {js => internal/js}/modules/k6/webcrypto/algorithm.go (100%) rename {js => internal/js}/modules/k6/webcrypto/base64.go (100%) rename {js => internal/js}/modules/k6/webcrypto/bits.go (100%) rename {js => internal/js}/modules/k6/webcrypto/cmd_run_test.go (96%) rename {js => internal/js}/modules/k6/webcrypto/crypto.go (100%) rename {js => internal/js}/modules/k6/webcrypto/elliptic_curve.go (100%) rename {js => internal/js}/modules/k6/webcrypto/encryption.go (100%) rename {js => internal/js}/modules/k6/webcrypto/errors.go (100%) rename {js => internal/js}/modules/k6/webcrypto/hash.go (100%) rename {js => internal/js}/modules/k6/webcrypto/hmac.go (100%) rename {js => internal/js}/modules/k6/webcrypto/jwk.go (100%) rename {js => internal/js}/modules/k6/webcrypto/key.go (100%) rename {js => internal/js}/modules/k6/webcrypto/module.go (100%) rename {js => internal/js}/modules/k6/webcrypto/params.go (100%) rename {js => internal/js}/modules/k6/webcrypto/rsa.go (100%) rename {js => internal/js}/modules/k6/webcrypto/signer.go (100%) rename {js => internal/js}/modules/k6/webcrypto/sobek.go (100%) rename {js => internal/js}/modules/k6/webcrypto/sobek_test.go (100%) rename {js => internal/js}/modules/k6/webcrypto/subtle_crypto.go (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/README.md (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/checkout.sh (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/crypto_test.go (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/generate-patches.sh (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/subtle_crypto_test.go (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/test_setup_test.go (93%) rename {js => internal/js}/modules/k6/webcrypto/tests/util/helpers.js (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__derive_bits_keys__ecdh_bits.js.patch (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__encrypt_decrypt__aes_gcm_vectors.js.patch (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__failures.js.patch (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__successes.js.patch (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__ec_importKey.https.any.js.patch (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__rsa_importKey.https.any.js.patch (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__symmetric_importKey.https.any.js.patch (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__ecdsa_vectors.js.patch (100%) rename {js => internal/js}/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__rsa.js.patch (100%) rename {js => internal/js}/modules/k6/webcrypto/types.go (100%) rename {js => internal/js}/modules/k6/ws/ws.go (100%) rename {js => internal/js}/modules/k6/ws/ws_test.go (99%) rename {js => internal/js}/modules_vu.go (92%) rename {js => internal/js}/path_resolution_test.go (99%) rename {js => internal/js}/runner.go (99%) rename {js => internal/js}/runner_test.go (99%) rename {js => internal/js}/share_test.go (98%) rename {js => internal/js}/summary-wrapper.js (100%) rename {js => internal/js}/summary.go (100%) rename {js => internal/js}/summary.js (100%) rename {js => internal/js}/summary_test.go (99%) rename {js => internal/js}/tc39/README.md (100%) rename {js => internal/js}/tc39/breaking_test_errors-experimental_enhanced.json (100%) rename {js => internal/js}/tc39/breaking_test_errors-extended.json (100%) rename {js => internal/js}/tc39/checkout.sh (100%) rename {js => internal/js}/tc39/tc39_norace_test.go (100%) rename {js => internal/js}/tc39/tc39_race_test.go (100%) rename {js => internal/js}/tc39/tc39_test.go (99%) rename {js => internal/js}/timeout_error.go (100%) rename {js => internal/js}/timeout_error_test.go (100%) rename {lib => internal/lib}/netext/grpcext/conn.go (100%) rename {lib => internal/lib}/netext/grpcext/conn_test.go (100%) rename {lib => internal/lib}/netext/grpcext/reflect.go (100%) rename {lib => internal/lib}/netext/grpcext/stream.go (100%) rename {lib => internal/lib}/strvals/doc.go (100%) rename {lib => internal/lib}/strvals/parser.go (100%) rename {lib => internal/lib}/strvals/parser_test.go (100%) rename {lib => internal/lib}/testutils/fs.go (100%) rename {lib => internal/lib}/testutils/grpcservice/route_guide.pb.go (100%) rename {lib => internal/lib}/testutils/grpcservice/route_guide.proto (100%) rename {lib => internal/lib}/testutils/grpcservice/route_guide_grpc.pb.go (100%) rename {lib => internal/lib}/testutils/grpcservice/service.go (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_any_testing/any_test.pb.go (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_any_testing/any_test.proto (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_protoset_testing/test.protoset (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_protoset_testing/test_message.proto (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_protoset_testing/test_service.proto (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_testing/nested_types.proto (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_testing/test.pb.go (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_testing/test.proto (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_testing/test_grpc.pb.go (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_wrappers_testing/service.go (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_wrappers_testing/test.pb.go (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_wrappers_testing/test.proto (100%) rename {lib => internal/lib}/testutils/httpmultibin/grpc_wrappers_testing/test_grpc.pb.go (100%) rename {lib => internal/lib}/testutils/httpmultibin/httpmultibin.go (98%) rename {lib => internal/lib}/testutils/httpmultibin/nested_types/nested_types.proto (100%) rename {lib => internal/lib}/testutils/logrus_hook.go (100%) rename {lib => internal/lib}/testutils/minirunner/minirunner.go (100%) rename {lib => internal/lib}/testutils/mockoutput/mockoutput.go (100%) rename {lib => internal/lib}/testutils/mockresolver/resolver.go (100%) rename {lib => internal/lib}/testutils/test_output.go (100%) rename {lib => internal/lib}/testutils/untar.go (100%) rename {lib => internal/lib}/trace/doc.go (100%) rename {lib => internal/lib}/trace/otel.go (99%) rename {lib => internal/lib}/trace/otel_test.go (100%) rename {loader => internal/loader}/filesystems.go (100%) rename {loader => internal/loader}/loader.go (100%) rename {loader => internal/loader}/loader_test.go (98%) rename {loader => internal/loader}/readsource.go (100%) rename {loader => internal/loader}/readsource_test.go (99%) rename {log => internal/log}/file.go (99%) rename {log => internal/log}/file_test.go (100%) rename {log => internal/log}/levels.go (100%) rename {log => internal/log}/levels_test.go (100%) rename {log => internal/log}/log.go (100%) rename {log => internal/log}/loki.go (99%) rename {log => internal/log}/loki_test.go (100%) rename {metrics => internal/metrics}/engine/engine.go (100%) rename {metrics => internal/metrics}/engine/engine_test.go (99%) rename {metrics => internal/metrics}/engine/ingester.go (100%) rename {metrics => internal/metrics}/engine/ingester_test.go (99%) rename {output => internal/output}/cloud/expv2/integration/integration_test.go (98%) rename {output => internal/output}/cloud/expv2/integration/testdata/metricset.json (100%) rename {output => internal/output}/cloud/expv2/pbcloud/gen.go (100%) rename {output => internal/output}/cloud/expv2/pbcloud/metric.pb.go (100%) rename {output => internal/output}/cloud/expv2/pbcloud/metric.proto (100%) rename {output => internal/output}/cloud/insights/collect.go (98%) rename {output => internal/output}/cloud/insights/collect_test.go (99%) rename {output => internal/output}/cloud/insights/doc.go (100%) rename {output => internal/output}/cloud/insights/enable.go (100%) rename {output => internal/output}/cloud/insights/flush.go (96%) rename {output => internal/output}/cloud/insights/flush_test.go (98%) rename {output => internal/output}/cloud/output.go (99%) rename {output => internal/output}/cloud/output_test.go (99%) rename {output => internal/output}/influxdb/bench_test.go (100%) rename {output => internal/output}/influxdb/config.go (100%) rename {output => internal/output}/influxdb/config_test.go (100%) rename {output => internal/output}/influxdb/output.go (100%) rename {output => internal/output}/influxdb/output_test.go (99%) rename {output => internal/output}/influxdb/util.go (100%) rename {output => internal/output}/influxdb/util_test.go (100%) rename {output => internal/output}/json/benchmark_test.go (95%) rename {output => internal/output}/json/json.go (100%) rename {output => internal/output}/json/json_easyjson.go (100%) rename {output => internal/output}/json/json_test.go (99%) rename {output => internal/output}/json/wrapper.go (100%) rename {ui => internal/ui}/console/doc.go (100%) rename {ui => internal/ui}/console/writer.go (100%) rename {ui => internal/ui}/doc.go (100%) rename {ui => internal/ui}/form.go (100%) rename {ui => internal/ui}/form_fields.go (100%) rename {ui => internal/ui}/form_fields_test.go (100%) rename {ui => internal/ui}/form_test.go (100%) rename {ui => internal/ui}/pb/doc.go (100%) rename {ui => internal/ui}/pb/helpers.go (100%) rename {ui => internal/ui}/pb/helpers_test.go (100%) rename {ui => internal/ui}/pb/progressbar.go (100%) rename {ui => internal/ui}/pb/progressbar_test.go (100%) rename {usage => internal/usage}/usage.go (100%) rename {usage => internal/usage}/usage_test.go (100%) diff --git a/.github/workflows/tc39.yml b/.github/workflows/tc39.yml index bd223f97a8f..e824211109e 100644 --- a/.github/workflows/tc39.yml +++ b/.github/workflows/tc39.yml @@ -27,6 +27,6 @@ jobs: - name: Run tests run: | set -x - cd js/tc39 + cd internal/js/tc39 sh checkout.sh go test -timeout 1h diff --git a/.github/workflows/wpt.yml b/.github/workflows/wpt.yml index 984fc926451..52d26cb0ba2 100644 --- a/.github/workflows/wpt.yml +++ b/.github/workflows/wpt.yml @@ -22,12 +22,12 @@ jobs: - name: Run Streams Tests run: | set -x - cd js/modules/k6/experimental/streams/tests + cd internal/js/modules/k6/experimental/streams/tests sh checkout.sh go test ../... -tags=wpt - name: Run Webcrypto Tests run: | set -x - cd js/modules/k6/webcrypto/tests + cd internal/js/modules/k6/webcrypto/tests sh checkout.sh go test ./... -tags=wpt diff --git a/.gitignore b/.gitignore index 345168d4ddb..3f181c1b56e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,8 @@ /k6.exe /dist /pkg-build -/js/tc39/TestTC39 -/js/modules/k6/experimental/streams/tests/wpt +/internal/js/tc39/TestTC39 +/internal/js/modules/k6/experimental/streams/tests/wpt .vscode *.sublime-workspace @@ -36,4 +36,4 @@ script.js /packaging/*.gpg # web platform tests -js/modules/k6/webcrypto/tests/wpt/ +/internal/js/modules/k6/webcrypto/tests/wpt/ diff --git a/api/v1/control_surface.go b/api/v1/control_surface.go index 12689cd1e3c..f4cb30d0c8a 100644 --- a/api/v1/control_surface.go +++ b/api/v1/control_surface.go @@ -3,10 +3,10 @@ package v1 import ( "context" - "go.k6.io/k6/execution" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/metrics/engine" "go.k6.io/k6/lib" "go.k6.io/k6/metrics" - "go.k6.io/k6/metrics/engine" ) // ControlSurface includes the methods the REST API can use to control and diff --git a/api/v1/group_routes_test.go b/api/v1/group_routes_test.go index e4fa47039d0..9c4c5c9c117 100644 --- a/api/v1/group_routes_test.go +++ b/api/v1/group_routes_test.go @@ -10,14 +10,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/execution" - "go.k6.io/k6/execution/local" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/execution/local" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/minirunner" + "go.k6.io/k6/internal/metrics/engine" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/minirunner" "go.k6.io/k6/metrics" - "go.k6.io/k6/metrics/engine" - "go.k6.io/k6/usage" ) func getTestPreInitState(tb testing.TB) *lib.TestPreInitState { diff --git a/api/v1/metric_routes_test.go b/api/v1/metric_routes_test.go index 253dd3094b4..4408528afa0 100644 --- a/api/v1/metric_routes_test.go +++ b/api/v1/metric_routes_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/lib/testutils/minirunner" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils/minirunner" "go.k6.io/k6/metrics" ) diff --git a/api/v1/setup_teardown_routes_test.go b/api/v1/setup_teardown_routes_test.go index 390e4ccba2a..d65c233a259 100644 --- a/api/v1/setup_teardown_routes_test.go +++ b/api/v1/setup_teardown_routes_test.go @@ -15,14 +15,14 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" - "go.k6.io/k6/execution" - "go.k6.io/k6/execution/local" - "go.k6.io/k6/js" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/execution/local" + "go.k6.io/k6/internal/js" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/metrics/engine" "go.k6.io/k6/lib" "go.k6.io/k6/lib/types" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" - "go.k6.io/k6/metrics/engine" "go.k6.io/k6/output" ) diff --git a/api/v1/status_routes.go b/api/v1/status_routes.go index ad1208c6a66..d0e45c46664 100644 --- a/api/v1/status_routes.go +++ b/api/v1/status_routes.go @@ -9,7 +9,7 @@ import ( "go.k6.io/k6/errext" "go.k6.io/k6/errext/exitcodes" - "go.k6.io/k6/execution" + "go.k6.io/k6/internal/execution" "go.k6.io/k6/lib/executor" ) diff --git a/api/v1/status_routes_test.go b/api/v1/status_routes_test.go index 71fc3616bc9..13da79c25cb 100644 --- a/api/v1/status_routes_test.go +++ b/api/v1/status_routes_test.go @@ -15,12 +15,12 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" - "go.k6.io/k6/execution" - "go.k6.io/k6/execution/local" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/execution/local" + "go.k6.io/k6/internal/lib/testutils/minirunner" + "go.k6.io/k6/internal/metrics/engine" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils/minirunner" "go.k6.io/k6/metrics" - "go.k6.io/k6/metrics/engine" "go.k6.io/k6/output" ) diff --git a/cloudapi/api_test.go b/cloudapi/api_test.go index a637122ca9d..39a67dd6a06 100644 --- a/cloudapi/api_test.go +++ b/cloudapi/api_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/lib/testutils" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/types" ) diff --git a/cloudapi/logs_test.go b/cloudapi/logs_test.go index 7be90e0ffab..f4f8fcdce0f 100644 --- a/cloudapi/logs_test.go +++ b/cloudapi/logs_test.go @@ -20,8 +20,8 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" ) func TestMsgParsing(t *testing.T) { diff --git a/cmd/execute.go b/cmd/execute.go new file mode 100644 index 00000000000..e84f839baba --- /dev/null +++ b/cmd/execute.go @@ -0,0 +1,10 @@ +// Package cmd is here to provide a way for xk6 to build a binary with added extensions +package cmd + +import "go.k6.io/k6/internal/cmd" + +// Execute exectues the k6 command +// It only is exported here for backwards compatibility and the ability to use xk6 to build extended k6 +func Execute() { + cmd.Execute() +} diff --git a/cmd/state/state.go b/cmd/state/state.go index cbfb2534dc3..4d375ff50f4 100644 --- a/cmd/state/state.go +++ b/cmd/state/state.go @@ -12,9 +12,9 @@ import ( "github.com/mattn/go-isatty" "github.com/sirupsen/logrus" - "go.k6.io/k6/event" + "go.k6.io/k6/internal/event" + "go.k6.io/k6/internal/ui/console" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/ui/console" ) const defaultConfigFileName = "config.json" diff --git a/cmd/tests/global_state.go b/cmd/tests/global_state.go new file mode 100644 index 00000000000..2b06bbf11d6 --- /dev/null +++ b/cmd/tests/global_state.go @@ -0,0 +1,17 @@ +// Package tests contains types needed for running integration tests that run k6 commands. +package tests + +import ( + "testing" + + "go.k6.io/k6/internal/cmd/tests" +) + +// GlobalTestState is a wrapper around GlobalState for use in tests. +type GlobalTestState = tests.GlobalTestState + +// NewGlobalTestState returns an initialized GlobalTestState, mocking all +// GlobalState fields for use in tests. +func NewGlobalTestState(tb testing.TB) *GlobalTestState { + return tests.NewGlobalTestState(tb) +} diff --git a/api/server.go b/internal/api/server.go similarity index 97% rename from api/server.go rename to internal/api/server.go index c9198068c31..14bd785052e 100644 --- a/api/server.go +++ b/internal/api/server.go @@ -13,10 +13,10 @@ import ( "github.com/sirupsen/logrus" v1 "go.k6.io/k6/api/v1" - "go.k6.io/k6/execution" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/metrics/engine" "go.k6.io/k6/lib" "go.k6.io/k6/metrics" - "go.k6.io/k6/metrics/engine" ) func newHandler(cs *v1.ControlSurface, profilingEnabled bool) http.Handler { diff --git a/api/server_test.go b/internal/api/server_test.go similarity index 98% rename from api/server_test.go rename to internal/api/server_test.go index 8735a32e6a3..596eed1b823 100644 --- a/api/server_test.go +++ b/internal/api/server_test.go @@ -10,7 +10,7 @@ import ( logtest "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" - "go.k6.io/k6/lib/testutils" + "go.k6.io/k6/internal/lib/testutils" ) func testHTTPHandler(rw http.ResponseWriter, _ *http.Request) { diff --git a/cloudapi/insights/client.go b/internal/cloudapi/insights/client.go similarity index 99% rename from cloudapi/insights/client.go rename to internal/cloudapi/insights/client.go index c30792551bc..3617f6b59b5 100644 --- a/cloudapi/insights/client.go +++ b/internal/cloudapi/insights/client.go @@ -17,7 +17,7 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/status" - "go.k6.io/k6/cloudapi/insights/proto/v1/ingester" + "go.k6.io/k6/internal/cloudapi/insights/proto/v1/ingester" ) const ( diff --git a/cloudapi/insights/client_test.go b/internal/cloudapi/insights/client_test.go similarity index 99% rename from cloudapi/insights/client_test.go rename to internal/cloudapi/insights/client_test.go index 5b39829cc07..0b3aec0473a 100644 --- a/cloudapi/insights/client_test.go +++ b/internal/cloudapi/insights/client_test.go @@ -13,7 +13,7 @@ import ( "google.golang.org/grpc/status" "google.golang.org/grpc/test/bufconn" - "go.k6.io/k6/cloudapi/insights/proto/v1/ingester" + "go.k6.io/k6/internal/cloudapi/insights/proto/v1/ingester" ) func newMockListener(t *testing.T, ingesterServer ingester.IngesterServiceServer) *bufconn.Listener { diff --git a/cloudapi/insights/doc.go b/internal/cloudapi/insights/doc.go similarity index 100% rename from cloudapi/insights/doc.go rename to internal/cloudapi/insights/doc.go diff --git a/cloudapi/insights/domain.go b/internal/cloudapi/insights/domain.go similarity index 100% rename from cloudapi/insights/domain.go rename to internal/cloudapi/insights/domain.go diff --git a/cloudapi/insights/mappers.go b/internal/cloudapi/insights/mappers.go similarity index 93% rename from cloudapi/insights/mappers.go rename to internal/cloudapi/insights/mappers.go index f83329407cd..b164c7f7542 100644 --- a/cloudapi/insights/mappers.go +++ b/internal/cloudapi/insights/mappers.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" - "go.k6.io/k6/cloudapi/insights/proto/v1/ingester" - "go.k6.io/k6/cloudapi/insights/proto/v1/k6" + "go.k6.io/k6/internal/cloudapi/insights/proto/v1/ingester" + "go.k6.io/k6/internal/cloudapi/insights/proto/v1/k6" ) func newBatchCreateRequestMetadatasRequest( diff --git a/cloudapi/insights/mappers_test.go b/internal/cloudapi/insights/mappers_test.go similarity index 94% rename from cloudapi/insights/mappers_test.go rename to internal/cloudapi/insights/mappers_test.go index d7f08c259ed..2c7c4bac4a6 100644 --- a/cloudapi/insights/mappers_test.go +++ b/internal/cloudapi/insights/mappers_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" - "go.k6.io/k6/cloudapi/insights/proto/v1/ingester" - "go.k6.io/k6/cloudapi/insights/proto/v1/k6" + "go.k6.io/k6/internal/cloudapi/insights/proto/v1/ingester" + "go.k6.io/k6/internal/cloudapi/insights/proto/v1/k6" ) func Test_newBatchCreateRequestMetadatasRequest_CorrectlyMapsDomainTypeToProtoDefinition(t *testing.T) { diff --git a/cloudapi/insights/proto/gen.go b/internal/cloudapi/insights/proto/gen.go similarity index 100% rename from cloudapi/insights/proto/gen.go rename to internal/cloudapi/insights/proto/gen.go diff --git a/cloudapi/insights/proto/v1/common/common.pb.go b/internal/cloudapi/insights/proto/v1/common/common.pb.go similarity index 100% rename from cloudapi/insights/proto/v1/common/common.pb.go rename to internal/cloudapi/insights/proto/v1/common/common.pb.go diff --git a/cloudapi/insights/proto/v1/common/common.proto b/internal/cloudapi/insights/proto/v1/common/common.proto similarity index 100% rename from cloudapi/insights/proto/v1/common/common.proto rename to internal/cloudapi/insights/proto/v1/common/common.proto diff --git a/cloudapi/insights/proto/v1/ingester/ingester.pb.go b/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go similarity index 99% rename from cloudapi/insights/proto/v1/ingester/ingester.pb.go rename to internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go index 0c5a5e6cb4e..76df2bf33c8 100644 --- a/cloudapi/insights/proto/v1/ingester/ingester.pb.go +++ b/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go @@ -7,8 +7,8 @@ package ingester import ( - k6 "go.k6.io/k6/cloudapi/insights/proto/v1/k6" - trace "go.k6.io/k6/cloudapi/insights/proto/v1/trace" + k6 "go.k6.io/k6/internal/cloudapi/insights/proto/v1/k6" + trace "go.k6.io/k6/internal/cloudapi/insights/proto/v1/trace" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" diff --git a/cloudapi/insights/proto/v1/ingester/ingester.proto b/internal/cloudapi/insights/proto/v1/ingester/ingester.proto similarity index 100% rename from cloudapi/insights/proto/v1/ingester/ingester.proto rename to internal/cloudapi/insights/proto/v1/ingester/ingester.proto diff --git a/cloudapi/insights/proto/v1/ingester/ingester_grpc.pb.go b/internal/cloudapi/insights/proto/v1/ingester/ingester_grpc.pb.go similarity index 100% rename from cloudapi/insights/proto/v1/ingester/ingester_grpc.pb.go rename to internal/cloudapi/insights/proto/v1/ingester/ingester_grpc.pb.go diff --git a/cloudapi/insights/proto/v1/k6/labels.pb.go b/internal/cloudapi/insights/proto/v1/k6/labels.pb.go similarity index 100% rename from cloudapi/insights/proto/v1/k6/labels.pb.go rename to internal/cloudapi/insights/proto/v1/k6/labels.pb.go diff --git a/cloudapi/insights/proto/v1/k6/labels.proto b/internal/cloudapi/insights/proto/v1/k6/labels.proto similarity index 100% rename from cloudapi/insights/proto/v1/k6/labels.proto rename to internal/cloudapi/insights/proto/v1/k6/labels.proto diff --git a/cloudapi/insights/proto/v1/k6/request_metadata.pb.go b/internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go similarity index 100% rename from cloudapi/insights/proto/v1/k6/request_metadata.pb.go rename to internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go diff --git a/cloudapi/insights/proto/v1/k6/request_metadata.proto b/internal/cloudapi/insights/proto/v1/k6/request_metadata.proto similarity index 100% rename from cloudapi/insights/proto/v1/k6/request_metadata.proto rename to internal/cloudapi/insights/proto/v1/k6/request_metadata.proto diff --git a/cloudapi/insights/proto/v1/trace/labels.pb.go b/internal/cloudapi/insights/proto/v1/trace/labels.pb.go similarity index 100% rename from cloudapi/insights/proto/v1/trace/labels.pb.go rename to internal/cloudapi/insights/proto/v1/trace/labels.pb.go diff --git a/cloudapi/insights/proto/v1/trace/labels.proto b/internal/cloudapi/insights/proto/v1/trace/labels.proto similarity index 100% rename from cloudapi/insights/proto/v1/trace/labels.proto rename to internal/cloudapi/insights/proto/v1/trace/labels.proto diff --git a/cloudapi/insights/proto/v1/trace/span.pb.go b/internal/cloudapi/insights/proto/v1/trace/span.pb.go similarity index 99% rename from cloudapi/insights/proto/v1/trace/span.pb.go rename to internal/cloudapi/insights/proto/v1/trace/span.pb.go index aad4db74bf1..83ce6b0b3d5 100644 --- a/cloudapi/insights/proto/v1/trace/span.pb.go +++ b/internal/cloudapi/insights/proto/v1/trace/span.pb.go @@ -7,7 +7,7 @@ package trace import ( - common "go.k6.io/k6/cloudapi/insights/proto/v1/common" + common "go.k6.io/k6/internal/cloudapi/insights/proto/v1/common" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" diff --git a/cloudapi/insights/proto/v1/trace/span.proto b/internal/cloudapi/insights/proto/v1/trace/span.proto similarity index 100% rename from cloudapi/insights/proto/v1/trace/span.proto rename to internal/cloudapi/insights/proto/v1/trace/span.proto diff --git a/cmd/archive.go b/internal/cmd/archive.go similarity index 100% rename from cmd/archive.go rename to internal/cmd/archive.go diff --git a/cmd/archive_test.go b/internal/cmd/archive_test.go similarity index 99% rename from cmd/archive_test.go rename to internal/cmd/archive_test.go index 35dbc684783..df821702945 100644 --- a/cmd/archive_test.go +++ b/internal/cmd/archive_test.go @@ -8,10 +8,10 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.k6.io/k6/cmd/tests" "go.k6.io/k6/errext/exitcodes" + "go.k6.io/k6/internal/cmd/tests" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" ) func TestArchiveThresholds(t *testing.T) { diff --git a/cmd/builtin_output_gen.go b/internal/cmd/builtin_output_gen.go similarity index 100% rename from cmd/builtin_output_gen.go rename to internal/cmd/builtin_output_gen.go diff --git a/cmd/cloud.go b/internal/cmd/cloud.go similarity index 99% rename from cmd/cloud.go rename to internal/cmd/cloud.go index 9c189606c04..ac48a07b92b 100644 --- a/cmd/cloud.go +++ b/internal/cmd/cloud.go @@ -16,9 +16,9 @@ import ( "go.k6.io/k6/cmd/state" "go.k6.io/k6/errext" "go.k6.io/k6/errext/exitcodes" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/consts" - "go.k6.io/k6/ui/pb" "github.com/fatih/color" "github.com/spf13/cobra" diff --git a/cmd/cloud_login.go b/internal/cmd/cloud_login.go similarity index 99% rename from cmd/cloud_login.go rename to internal/cmd/cloud_login.go index 0213fcf57b4..e220315a285 100644 --- a/cmd/cloud_login.go +++ b/internal/cmd/cloud_login.go @@ -13,8 +13,8 @@ import ( "go.k6.io/k6/cloudapi" "go.k6.io/k6/cmd/state" + "go.k6.io/k6/internal/ui" "go.k6.io/k6/lib/consts" - "go.k6.io/k6/ui" ) const cloudLoginCommandName = "login" diff --git a/cmd/cloud_run.go b/internal/cmd/cloud_run.go similarity index 98% rename from cmd/cloud_run.go rename to internal/cmd/cloud_run.go index 6824bbe1100..53a4b8e7a1f 100644 --- a/cmd/cloud_run.go +++ b/internal/cmd/cloud_run.go @@ -9,8 +9,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "go.k6.io/k6/execution" - "go.k6.io/k6/execution/local" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/execution/local" ) const cloudRunCommandName string = "run" diff --git a/cmd/cloud_upload.go b/internal/cmd/cloud_upload.go similarity index 100% rename from cmd/cloud_upload.go rename to internal/cmd/cloud_upload.go diff --git a/cmd/common.go b/internal/cmd/common.go similarity index 100% rename from cmd/common.go rename to internal/cmd/common.go diff --git a/cmd/config.go b/internal/cmd/config.go similarity index 100% rename from cmd/config.go rename to internal/cmd/config.go diff --git a/cmd/config_consolidation_test.go b/internal/cmd/config_consolidation_test.go similarity index 99% rename from cmd/config_consolidation_test.go rename to internal/cmd/config_consolidation_test.go index e8bad7d4a78..89c9968134d 100644 --- a/cmd/config_consolidation_test.go +++ b/internal/cmd/config_consolidation_test.go @@ -10,7 +10,7 @@ import ( "gopkg.in/guregu/null.v3" "go.k6.io/k6/cmd/state" - "go.k6.io/k6/cmd/tests" + "go.k6.io/k6/internal/cmd/tests" "go.k6.io/k6/lib" "go.k6.io/k6/lib/executor" "go.k6.io/k6/lib/fsext" diff --git a/cmd/config_test.go b/internal/cmd/config_test.go similarity index 100% rename from cmd/config_test.go rename to internal/cmd/config_test.go diff --git a/cmd/doc.go b/internal/cmd/doc.go similarity index 100% rename from cmd/doc.go rename to internal/cmd/doc.go diff --git a/cmd/inspect.go b/internal/cmd/inspect.go similarity index 100% rename from cmd/inspect.go rename to internal/cmd/inspect.go diff --git a/cmd/login.go b/internal/cmd/login.go similarity index 100% rename from cmd/login.go rename to internal/cmd/login.go diff --git a/cmd/login_cloud.go b/internal/cmd/login_cloud.go similarity index 99% rename from cmd/login_cloud.go rename to internal/cmd/login_cloud.go index 0aadf7fb749..95d1376f98c 100644 --- a/cmd/login_cloud.go +++ b/internal/cmd/login_cloud.go @@ -13,8 +13,8 @@ import ( "go.k6.io/k6/cloudapi" "go.k6.io/k6/cmd/state" + "go.k6.io/k6/internal/ui" "go.k6.io/k6/lib/consts" - "go.k6.io/k6/ui" ) //nolint:funlen,gocognit diff --git a/cmd/login_influxdb.go b/internal/cmd/login_influxdb.go similarity index 97% rename from cmd/login_influxdb.go rename to internal/cmd/login_influxdb.go index 3e8a9ae0a03..ca5e3bfb00a 100644 --- a/cmd/login_influxdb.go +++ b/internal/cmd/login_influxdb.go @@ -10,8 +10,8 @@ import ( "gopkg.in/guregu/null.v3" "go.k6.io/k6/cmd/state" - "go.k6.io/k6/output/influxdb" - "go.k6.io/k6/ui" + "go.k6.io/k6/internal/output/influxdb" + "go.k6.io/k6/internal/ui" ) //nolint:funlen diff --git a/cmd/new.go b/internal/cmd/new.go similarity index 98% rename from cmd/new.go rename to internal/cmd/new.go index b0932481832..d8b2d3b48cc 100644 --- a/cmd/new.go +++ b/internal/cmd/new.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "go.k6.io/k6/cmd/state" - "go.k6.io/k6/cmd/templates" + "go.k6.io/k6/internal/cmd/templates" "go.k6.io/k6/lib/fsext" ) diff --git a/cmd/new_test.go b/internal/cmd/new_test.go similarity index 98% rename from cmd/new_test.go rename to internal/cmd/new_test.go index f451889feda..8a669037e98 100644 --- a/cmd/new_test.go +++ b/internal/cmd/new_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/cmd/tests" + "go.k6.io/k6/internal/cmd/tests" "go.k6.io/k6/lib/fsext" ) diff --git a/cmd/options.go b/internal/cmd/options.go similarity index 100% rename from cmd/options.go rename to internal/cmd/options.go diff --git a/cmd/options_test.go b/internal/cmd/options_test.go similarity index 100% rename from cmd/options_test.go rename to internal/cmd/options_test.go diff --git a/cmd/outputs.go b/internal/cmd/outputs.go similarity index 98% rename from cmd/outputs.go rename to internal/cmd/outputs.go index fa50cd1530f..aa3dd02ed0c 100644 --- a/cmd/outputs.go +++ b/internal/cmd/outputs.go @@ -8,12 +8,12 @@ import ( "go.k6.io/k6/cmd/state" "go.k6.io/k6/ext" + "go.k6.io/k6/internal/output/cloud" + "go.k6.io/k6/internal/output/influxdb" + "go.k6.io/k6/internal/output/json" "go.k6.io/k6/lib" "go.k6.io/k6/output" - "go.k6.io/k6/output/cloud" "go.k6.io/k6/output/csv" - "go.k6.io/k6/output/influxdb" - "go.k6.io/k6/output/json" "github.com/grafana/xk6-dashboard/dashboard" "github.com/grafana/xk6-output-opentelemetry/pkg/opentelemetry" diff --git a/cmd/outputs_cloud.go b/internal/cmd/outputs_cloud.go similarity index 100% rename from cmd/outputs_cloud.go rename to internal/cmd/outputs_cloud.go diff --git a/cmd/outputs_test.go b/internal/cmd/outputs_test.go similarity index 100% rename from cmd/outputs_test.go rename to internal/cmd/outputs_test.go diff --git a/cmd/pause.go b/internal/cmd/pause.go similarity index 100% rename from cmd/pause.go rename to internal/cmd/pause.go diff --git a/cmd/report.go b/internal/cmd/report.go similarity index 97% rename from cmd/report.go rename to internal/cmd/report.go index dbe92e8efda..7dc2a767269 100644 --- a/cmd/report.go +++ b/internal/cmd/report.go @@ -8,9 +8,9 @@ import ( "runtime" "strconv" - "go.k6.io/k6/execution" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib/consts" - "go.k6.io/k6/usage" ) func createReport(u *usage.Usage, execScheduler *execution.Scheduler) map[string]any { diff --git a/cmd/report_test.go b/internal/cmd/report_test.go similarity index 95% rename from cmd/report_test.go rename to internal/cmd/report_test.go index a1ee1e16b67..0b4ef1ea8dd 100644 --- a/cmd/report_test.go +++ b/internal/cmd/report_test.go @@ -6,13 +6,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/execution" - "go.k6.io/k6/execution/local" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/execution/local" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" "go.k6.io/k6/lib/consts" "go.k6.io/k6/lib/executor" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/usage" "gopkg.in/guregu/null.v3" ) diff --git a/cmd/resume.go b/internal/cmd/resume.go similarity index 100% rename from cmd/resume.go rename to internal/cmd/resume.go diff --git a/cmd/root.go b/internal/cmd/root.go similarity index 99% rename from cmd/root.go rename to internal/cmd/root.go index 44e0a13b34d..88da45acb26 100644 --- a/cmd/root.go +++ b/internal/cmd/root.go @@ -19,7 +19,7 @@ import ( "go.k6.io/k6/cmd/state" "go.k6.io/k6/errext" "go.k6.io/k6/errext/exitcodes" - "go.k6.io/k6/log" + "go.k6.io/k6/internal/log" ) const waitLoggerCloseTimeout = time.Second * 5 diff --git a/cmd/root_test.go b/internal/cmd/root_test.go similarity index 98% rename from cmd/root_test.go rename to internal/cmd/root_test.go index 44e52790d41..248d9ad8a3b 100644 --- a/cmd/root_test.go +++ b/internal/cmd/root_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.k6.io/k6/cmd/tests" "go.k6.io/k6/errext/exitcodes" + "go.k6.io/k6/internal/cmd/tests" ) func TestRootCommandHelpDisplayCommands(t *testing.T) { diff --git a/cmd/run.go b/internal/cmd/run.go similarity index 98% rename from cmd/run.go rename to internal/cmd/run.go index 1a0e04c8ffc..3b8905d44c2 100644 --- a/cmd/run.go +++ b/internal/cmd/run.go @@ -16,21 +16,21 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "go.k6.io/k6/api" "go.k6.io/k6/cmd/state" "go.k6.io/k6/errext" "go.k6.io/k6/errext/exitcodes" - "go.k6.io/k6/event" - "go.k6.io/k6/execution" - "go.k6.io/k6/execution/local" + "go.k6.io/k6/internal/api" + "go.k6.io/k6/internal/event" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/execution/local" + "go.k6.io/k6/internal/lib/trace" + "go.k6.io/k6/internal/metrics/engine" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/js/common" "go.k6.io/k6/lib" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/trace" "go.k6.io/k6/metrics" - "go.k6.io/k6/metrics/engine" "go.k6.io/k6/output" - "go.k6.io/k6/ui/pb" ) // cmdRun handles the `k6 run` sub-command diff --git a/cmd/run_test.go b/internal/cmd/run_test.go similarity index 99% rename from cmd/run_test.go rename to internal/cmd/run_test.go index 4b562359ccf..93e7a902ed2 100644 --- a/cmd/run_test.go +++ b/internal/cmd/run_test.go @@ -16,11 +16,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/cmd/tests" "go.k6.io/k6/errext" "go.k6.io/k6/errext/exitcodes" + "go.k6.io/k6/internal/cmd/tests" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" ) type mockWriter struct { diff --git a/cmd/runtime_options.go b/internal/cmd/runtime_options.go similarity index 100% rename from cmd/runtime_options.go rename to internal/cmd/runtime_options.go diff --git a/cmd/runtime_options_test.go b/internal/cmd/runtime_options_test.go similarity index 99% rename from cmd/runtime_options_test.go rename to internal/cmd/runtime_options_test.go index de484839de7..fe9b21eb416 100644 --- a/cmd/runtime_options_test.go +++ b/internal/cmd/runtime_options_test.go @@ -10,12 +10,12 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" - "go.k6.io/k6/cmd/tests" + "go.k6.io/k6/internal/cmd/tests" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) type runtimeOptionsTestCase struct { diff --git a/cmd/scale.go b/internal/cmd/scale.go similarity index 100% rename from cmd/scale.go rename to internal/cmd/scale.go diff --git a/cmd/stats.go b/internal/cmd/stats.go similarity index 100% rename from cmd/stats.go rename to internal/cmd/stats.go diff --git a/cmd/status.go b/internal/cmd/status.go similarity index 100% rename from cmd/status.go rename to internal/cmd/status.go diff --git a/cmd/stdlog_integration_test.go b/internal/cmd/stdlog_integration_test.go similarity index 92% rename from cmd/stdlog_integration_test.go rename to internal/cmd/stdlog_integration_test.go index c47e771d8f6..99556ee1bd1 100644 --- a/cmd/stdlog_integration_test.go +++ b/internal/cmd/stdlog_integration_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/cmd/tests" - "go.k6.io/k6/lib/testutils/httpmultibin" + "go.k6.io/k6/internal/cmd/tests" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" ) // SetOutput sets the global log so it is racy with other tests diff --git a/cmd/templates/browser.js b/internal/cmd/templates/browser.js similarity index 100% rename from cmd/templates/browser.js rename to internal/cmd/templates/browser.js diff --git a/cmd/templates/minimal.js b/internal/cmd/templates/minimal.js similarity index 100% rename from cmd/templates/minimal.js rename to internal/cmd/templates/minimal.js diff --git a/cmd/templates/protocol.js b/internal/cmd/templates/protocol.js similarity index 100% rename from cmd/templates/protocol.js rename to internal/cmd/templates/protocol.js diff --git a/cmd/templates/templates.go b/internal/cmd/templates/templates.go similarity index 100% rename from cmd/templates/templates.go rename to internal/cmd/templates/templates.go diff --git a/cmd/test_load.go b/internal/cmd/test_load.go similarity index 99% rename from cmd/test_load.go rename to internal/cmd/test_load.go index f57516acb28..1b85817c33c 100644 --- a/cmd/test_load.go +++ b/internal/cmd/test_load.go @@ -16,13 +16,13 @@ import ( "go.k6.io/k6/cmd/state" "go.k6.io/k6/errext" "go.k6.io/k6/errext/exitcodes" - "go.k6.io/k6/js" + "go.k6.io/k6/internal/js" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/js/modules" "go.k6.io/k6/lib" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) const ( diff --git a/cmd/testdata/abort.js b/internal/cmd/testdata/abort.js similarity index 100% rename from cmd/testdata/abort.js rename to internal/cmd/testdata/abort.js diff --git a/cmd/testdata/abort_initerr.js b/internal/cmd/testdata/abort_initerr.js similarity index 100% rename from cmd/testdata/abort_initerr.js rename to internal/cmd/testdata/abort_initerr.js diff --git a/cmd/testdata/abort_initvu.js b/internal/cmd/testdata/abort_initvu.js similarity index 100% rename from cmd/testdata/abort_initvu.js rename to internal/cmd/testdata/abort_initvu.js diff --git a/cmd/testdata/abort_teardown.js b/internal/cmd/testdata/abort_teardown.js similarity index 100% rename from cmd/testdata/abort_teardown.js rename to internal/cmd/testdata/abort_teardown.js diff --git a/cmd/testdata/example.har b/internal/cmd/testdata/example.har similarity index 100% rename from cmd/testdata/example.har rename to internal/cmd/testdata/example.har diff --git a/cmd/testdata/example.js b/internal/cmd/testdata/example.js similarity index 100% rename from cmd/testdata/example.js rename to internal/cmd/testdata/example.js diff --git a/cmd/testdata/initerr.js b/internal/cmd/testdata/initerr.js similarity index 100% rename from cmd/testdata/initerr.js rename to internal/cmd/testdata/initerr.js diff --git a/cmd/testdata/invalidconfig/invalid.json b/internal/cmd/testdata/invalidconfig/invalid.json similarity index 100% rename from cmd/testdata/invalidconfig/invalid.json rename to internal/cmd/testdata/invalidconfig/invalid.json diff --git a/cmd/testdata/invalidconfig/invalid_option.js b/internal/cmd/testdata/invalidconfig/invalid_option.js similarity index 100% rename from cmd/testdata/invalidconfig/invalid_option.js rename to internal/cmd/testdata/invalidconfig/invalid_option.js diff --git a/cmd/testdata/invalidconfig/invalid_scenario.js b/internal/cmd/testdata/invalidconfig/invalid_scenario.js similarity index 100% rename from cmd/testdata/invalidconfig/invalid_scenario.js rename to internal/cmd/testdata/invalidconfig/invalid_scenario.js diff --git a/cmd/testdata/invalidconfig/option_env.js b/internal/cmd/testdata/invalidconfig/option_env.js similarity index 100% rename from cmd/testdata/invalidconfig/option_env.js rename to internal/cmd/testdata/invalidconfig/option_env.js diff --git a/cmd/testdata/thresholds/empty_sink_no_nan.js b/internal/cmd/testdata/thresholds/empty_sink_no_nan.js similarity index 100% rename from cmd/testdata/thresholds/empty_sink_no_nan.js rename to internal/cmd/testdata/thresholds/empty_sink_no_nan.js diff --git a/cmd/testdata/thresholds/malformed_expression.js b/internal/cmd/testdata/thresholds/malformed_expression.js similarity index 100% rename from cmd/testdata/thresholds/malformed_expression.js rename to internal/cmd/testdata/thresholds/malformed_expression.js diff --git a/cmd/testdata/thresholds/name_contains_tokens.js b/internal/cmd/testdata/thresholds/name_contains_tokens.js similarity index 100% rename from cmd/testdata/thresholds/name_contains_tokens.js rename to internal/cmd/testdata/thresholds/name_contains_tokens.js diff --git a/cmd/testdata/thresholds/non_existing_metric.js b/internal/cmd/testdata/thresholds/non_existing_metric.js similarity index 100% rename from cmd/testdata/thresholds/non_existing_metric.js rename to internal/cmd/testdata/thresholds/non_existing_metric.js diff --git a/cmd/testdata/thresholds/thresholds_on_submetric_without_samples.js b/internal/cmd/testdata/thresholds/thresholds_on_submetric_without_samples.js similarity index 100% rename from cmd/testdata/thresholds/thresholds_on_submetric_without_samples.js rename to internal/cmd/testdata/thresholds/thresholds_on_submetric_without_samples.js diff --git a/cmd/testdata/thresholds/unsupported_aggregation_method.js b/internal/cmd/testdata/thresholds/unsupported_aggregation_method.js similarity index 100% rename from cmd/testdata/thresholds/unsupported_aggregation_method.js rename to internal/cmd/testdata/thresholds/unsupported_aggregation_method.js diff --git a/cmd/tests/cmd_cloud_run_test.go b/internal/cmd/tests/cmd_cloud_run_test.go similarity index 99% rename from cmd/tests/cmd_cloud_run_test.go rename to internal/cmd/tests/cmd_cloud_run_test.go index c6706a93b92..ae346b578d7 100644 --- a/cmd/tests/cmd_cloud_run_test.go +++ b/internal/cmd/tests/cmd_cloud_run_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" "go.k6.io/k6/cloudapi" - "go.k6.io/k6/cmd" "go.k6.io/k6/errext/exitcodes" + "go.k6.io/k6/internal/cmd" "go.k6.io/k6/lib/fsext" ) diff --git a/cmd/tests/cmd_cloud_test.go b/internal/cmd/tests/cmd_cloud_test.go similarity index 99% rename from cmd/tests/cmd_cloud_test.go rename to internal/cmd/tests/cmd_cloud_test.go index 69fff4284f6..dabb701af5c 100644 --- a/cmd/tests/cmd_cloud_test.go +++ b/internal/cmd/tests/cmd_cloud_test.go @@ -11,10 +11,10 @@ import ( "testing" "go.k6.io/k6/cloudapi" - "go.k6.io/k6/cmd" "go.k6.io/k6/errext/exitcodes" + "go.k6.io/k6/internal/cmd" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/cmd/tests/cmd_cloud_upload_test.go b/internal/cmd/tests/cmd_cloud_upload_test.go similarity index 98% rename from cmd/tests/cmd_cloud_upload_test.go rename to internal/cmd/tests/cmd_cloud_upload_test.go index 29c748867b5..2c6b9c34e7b 100644 --- a/cmd/tests/cmd_cloud_upload_test.go +++ b/internal/cmd/tests/cmd_cloud_upload_test.go @@ -10,9 +10,9 @@ import ( "testing" "go.k6.io/k6/cloudapi" - "go.k6.io/k6/cmd" + "go.k6.io/k6/internal/cmd" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/cmd/tests/cmd_run_grpc_test.go b/internal/cmd/tests/cmd_run_grpc_test.go similarity index 94% rename from cmd/tests/cmd_run_grpc_test.go rename to internal/cmd/tests/cmd_run_grpc_test.go index 684782549f5..a7399db4428 100644 --- a/cmd/tests/cmd_run_grpc_test.go +++ b/internal/cmd/tests/cmd_run_grpc_test.go @@ -5,14 +5,14 @@ import ( "path/filepath" "testing" - "go.k6.io/k6/cmd" + "go.k6.io/k6/internal/cmd" "go.k6.io/k6/lib/fsext" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -const projectRootPath = "../../" +const projectRootPath = "../../../" // TestGRPCInputOutput runs same k6's scripts that we have in example folder // it check that output contains/not contains cetane things @@ -90,7 +90,7 @@ func TestGRPCInputOutput(t *testing.T) { // Read the proto file from the testutils package // it's same that we use in the examples - proto, err := os.ReadFile(projectRootPath + "lib/testutils/grpcservice/route_guide.proto") //nolint:forbidigo + proto, err := os.ReadFile(projectRootPath + "internal/lib/testutils/grpcservice/route_guide.proto") //nolint:forbidigo require.NoError(t, err) for name, test := range tc { diff --git a/cmd/tests/cmd_run_test.go b/internal/cmd/tests/cmd_run_test.go similarity index 99% rename from cmd/tests/cmd_run_test.go rename to internal/cmd/tests/cmd_run_test.go index 0ad0304372a..b306a98e594 100644 --- a/cmd/tests/cmd_run_test.go +++ b/internal/cmd/tests/cmd_run_test.go @@ -24,15 +24,15 @@ import ( "github.com/stretchr/testify/require" "github.com/tidwall/gjson" "go.k6.io/k6/cloudapi" - "go.k6.io/k6/cmd" - "go.k6.io/k6/cmd/tests/events" "go.k6.io/k6/errext/exitcodes" - "go.k6.io/k6/event" + "go.k6.io/k6/internal/cmd" + "go.k6.io/k6/internal/cmd/tests/events" + "go.k6.io/k6/internal/event" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" "go.k6.io/k6/js/modules" "go.k6.io/k6/lib/consts" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" ) func TestVersion(t *testing.T) { diff --git a/cmd/tests/doc.go b/internal/cmd/tests/doc.go similarity index 100% rename from cmd/tests/doc.go rename to internal/cmd/tests/doc.go diff --git a/cmd/tests/eventloop_test.go b/internal/cmd/tests/eventloop_test.go similarity index 99% rename from cmd/tests/eventloop_test.go rename to internal/cmd/tests/eventloop_test.go index 1bf7579dea3..7167fb6032e 100644 --- a/cmd/tests/eventloop_test.go +++ b/internal/cmd/tests/eventloop_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.k6.io/k6/cmd" + "go.k6.io/k6/internal/cmd" ) func TestEventLoop(t *testing.T) { diff --git a/cmd/tests/events/events.go b/internal/cmd/tests/events/events.go similarity index 98% rename from cmd/tests/events/events.go rename to internal/cmd/tests/events/events.go index 8db59e1ca8f..2a384a449fa 100644 --- a/cmd/tests/events/events.go +++ b/internal/cmd/tests/events/events.go @@ -4,7 +4,7 @@ package events import ( "sync" - "go.k6.io/k6/event" + "go.k6.io/k6/internal/event" "go.k6.io/k6/js/modules" ) diff --git a/cmd/tests/grpc.go b/internal/cmd/tests/grpc.go similarity index 94% rename from cmd/tests/grpc.go rename to internal/cmd/tests/grpc.go index c0c812abc1b..d9cc8088572 100644 --- a/cmd/tests/grpc.go +++ b/internal/cmd/tests/grpc.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "go.k6.io/k6/lib/testutils/grpcservice" + "go.k6.io/k6/internal/lib/testutils/grpcservice" "google.golang.org/grpc" "google.golang.org/grpc/reflection" diff --git a/cmd/tests/test_state.go b/internal/cmd/tests/test_state.go similarity index 96% rename from cmd/tests/test_state.go rename to internal/cmd/tests/test_state.go index 1459ed97b7a..b2d5dd55759 100644 --- a/cmd/tests/test_state.go +++ b/internal/cmd/tests/test_state.go @@ -15,10 +15,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.k6.io/k6/cmd/state" - "go.k6.io/k6/event" + "go.k6.io/k6/internal/event" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/ui/console" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/ui/console" ) // GlobalTestState is a wrapper around GlobalState for use in tests. diff --git a/cmd/tests/testdata/archives/archive_v0.42.0_linux.tar b/internal/cmd/tests/testdata/archives/archive_v0.42.0_linux.tar similarity index 100% rename from cmd/tests/testdata/archives/archive_v0.42.0_linux.tar rename to internal/cmd/tests/testdata/archives/archive_v0.42.0_linux.tar diff --git a/cmd/tests/testdata/archives/archive_v0.42.0_windows.tar b/internal/cmd/tests/testdata/archives/archive_v0.42.0_windows.tar similarity index 100% rename from cmd/tests/testdata/archives/archive_v0.42.0_windows.tar rename to internal/cmd/tests/testdata/archives/archive_v0.42.0_windows.tar diff --git a/cmd/tests/testdata/archives/archive_v0.46.0_with_loadimpact_option.tar b/internal/cmd/tests/testdata/archives/archive_v0.46.0_with_loadimpact_option.tar similarity index 100% rename from cmd/tests/testdata/archives/archive_v0.46.0_with_loadimpact_option.tar rename to internal/cmd/tests/testdata/archives/archive_v0.46.0_with_loadimpact_option.tar diff --git a/cmd/tests/tests.go b/internal/cmd/tests/tests.go similarity index 100% rename from cmd/tests/tests.go rename to internal/cmd/tests/tests.go diff --git a/cmd/tests/tests_test.go b/internal/cmd/tests/tests_test.go similarity index 96% rename from cmd/tests/tests_test.go rename to internal/cmd/tests/tests_test.go index c52ec80cd28..c4aba9d2d44 100644 --- a/cmd/tests/tests_test.go +++ b/internal/cmd/tests/tests_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.k6.io/k6/cmd" + "go.k6.io/k6/internal/cmd" ) func TestMain(m *testing.M) { diff --git a/cmd/ui.go b/internal/cmd/ui.go similarity index 99% rename from cmd/ui.go rename to internal/cmd/ui.go index d0228148b37..1beaece013f 100644 --- a/cmd/ui.go +++ b/internal/cmd/ui.go @@ -18,11 +18,11 @@ import ( "gopkg.in/yaml.v3" "go.k6.io/k6/cmd/state" + "go.k6.io/k6/internal/metrics/engine" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/consts" - "go.k6.io/k6/metrics/engine" "go.k6.io/k6/output" - "go.k6.io/k6/ui/pb" ) const ( diff --git a/cmd/ui_test.go b/internal/cmd/ui_test.go similarity index 98% rename from cmd/ui_test.go rename to internal/cmd/ui_test.go index de221db9dd3..10e4d680c52 100644 --- a/cmd/ui_test.go +++ b/internal/cmd/ui_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "go.k6.io/k6/ui/pb" + "go.k6.io/k6/internal/ui/pb" ) // Return progressbars with different content lengths, to test for diff --git a/cmd/ui_unix.go b/internal/cmd/ui_unix.go similarity index 100% rename from cmd/ui_unix.go rename to internal/cmd/ui_unix.go diff --git a/cmd/ui_windows.go b/internal/cmd/ui_windows.go similarity index 100% rename from cmd/ui_windows.go rename to internal/cmd/ui_windows.go diff --git a/cmd/version.go b/internal/cmd/version.go similarity index 100% rename from cmd/version.go rename to internal/cmd/version.go diff --git a/cmd/version_test.go b/internal/cmd/version_test.go similarity index 98% rename from cmd/version_test.go rename to internal/cmd/version_test.go index 7f8c0674372..a42b5b09eb2 100644 --- a/cmd/version_test.go +++ b/internal/cmd/version_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.k6.io/k6/cmd/tests" + "go.k6.io/k6/internal/cmd/tests" "go.k6.io/k6/lib/consts" ) diff --git a/event/doc.go b/internal/event/doc.go similarity index 100% rename from event/doc.go rename to internal/event/doc.go diff --git a/event/event.go b/internal/event/event.go similarity index 100% rename from event/event.go rename to internal/event/event.go diff --git a/event/system.go b/internal/event/system.go similarity index 100% rename from event/system.go rename to internal/event/system.go diff --git a/event/system_test.go b/internal/event/system_test.go similarity index 100% rename from event/system_test.go rename to internal/event/system_test.go diff --git a/event/type.go b/internal/event/type.go similarity index 100% rename from event/type.go rename to internal/event/type.go diff --git a/event/type_gen.go b/internal/event/type_gen.go similarity index 100% rename from event/type_gen.go rename to internal/event/type_gen.go diff --git a/execution/abort.go b/internal/execution/abort.go similarity index 100% rename from execution/abort.go rename to internal/execution/abort.go diff --git a/execution/controller.go b/internal/execution/controller.go similarity index 100% rename from execution/controller.go rename to internal/execution/controller.go diff --git a/execution/local/controller.go b/internal/execution/local/controller.go similarity index 100% rename from execution/local/controller.go rename to internal/execution/local/controller.go diff --git a/execution/pkg.go b/internal/execution/pkg.go similarity index 100% rename from execution/pkg.go rename to internal/execution/pkg.go diff --git a/execution/scheduler.go b/internal/execution/scheduler.go similarity index 99% rename from execution/scheduler.go rename to internal/execution/scheduler.go index 11832b7a81c..a865919df54 100644 --- a/execution/scheduler.go +++ b/internal/execution/scheduler.go @@ -11,9 +11,9 @@ import ( "github.com/sirupsen/logrus" "go.k6.io/k6/errext" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) // A Scheduler is in charge of most of the test execution - initializing VUs and diff --git a/execution/scheduler_ext_exec_test.go b/internal/execution/scheduler_ext_exec_test.go similarity index 98% rename from execution/scheduler_ext_exec_test.go rename to internal/execution/scheduler_ext_exec_test.go index aa111bf851c..057470d1d52 100644 --- a/execution/scheduler_ext_exec_test.go +++ b/internal/execution/scheduler_ext_exec_test.go @@ -11,12 +11,12 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js" + "go.k6.io/k6/internal/js" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) // TODO: rewrite and/or move these as integration tests to reduce boilerplate diff --git a/execution/scheduler_ext_test.go b/internal/execution/scheduler_ext_test.go similarity index 99% rename from execution/scheduler_ext_test.go rename to internal/execution/scheduler_ext_test.go index b512245ff83..e7458bac37a 100644 --- a/execution/scheduler_ext_test.go +++ b/internal/execution/scheduler_ext_test.go @@ -18,21 +18,21 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" - "go.k6.io/k6/execution" - "go.k6.io/k6/execution/local" - "go.k6.io/k6/js" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/execution/local" + "go.k6.io/k6/internal/js" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" + "go.k6.io/k6/internal/lib/testutils/minirunner" + "go.k6.io/k6/internal/lib/testutils/mockresolver" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" "go.k6.io/k6/lib/executor" "go.k6.io/k6/lib/netext" "go.k6.io/k6/lib/netext/httpext" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" - "go.k6.io/k6/lib/testutils/minirunner" - "go.k6.io/k6/lib/testutils/mockresolver" "go.k6.io/k6/lib/types" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) func getTestPreInitState(tb testing.TB) *lib.TestPreInitState { diff --git a/execution/scheduler_int_test.go b/internal/execution/scheduler_int_test.go similarity index 95% rename from execution/scheduler_int_test.go rename to internal/execution/scheduler_int_test.go index 455e4f198e2..689cb65e344 100644 --- a/execution/scheduler_int_test.go +++ b/internal/execution/scheduler_int_test.go @@ -5,10 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.k6.io/k6/execution/local" + "go.k6.io/k6/internal/execution/local" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/minirunner" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/minirunner" "go.k6.io/k6/metrics" ) diff --git a/js/bundle.go b/internal/js/bundle.go similarity index 99% rename from js/bundle.go rename to internal/js/bundle.go index 4894b3a0bc7..f64202a6817 100644 --- a/js/bundle.go +++ b/internal/js/bundle.go @@ -17,15 +17,15 @@ import ( "go.k6.io/k6/errext" "go.k6.io/k6/errext/exitcodes" - "go.k6.io/k6/event" + "go.k6.io/k6/internal/event" + "go.k6.io/k6/internal/js/compiler" + "go.k6.io/k6/internal/js/eventloop" + "go.k6.io/k6/internal/loader" "go.k6.io/k6/js/common" - "go.k6.io/k6/js/compiler" - "go.k6.io/k6/js/eventloop" "go.k6.io/k6/js/modules" "go.k6.io/k6/lib" "go.k6.io/k6/lib/consts" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/loader" ) // A Bundle is a self-contained bundle of scripts and resources. diff --git a/js/bundle_test.go b/internal/js/bundle_test.go similarity index 99% rename from js/bundle_test.go rename to internal/js/bundle_test.go index 0264ca31002..bc3f564b8bc 100644 --- a/js/bundle_test.go +++ b/internal/js/bundle_test.go @@ -19,14 +19,14 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" "go.k6.io/k6/lib/consts" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/lib/types" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) const isWindows = runtime.GOOS == "windows" diff --git a/js/compiler/compiler.go b/internal/js/compiler/compiler.go similarity index 99% rename from js/compiler/compiler.go rename to internal/js/compiler/compiler.go index 35140c36fae..265872df2f8 100644 --- a/js/compiler/compiler.go +++ b/internal/js/compiler/compiler.go @@ -15,8 +15,8 @@ import ( "github.com/grafana/sobek/parser" "github.com/sirupsen/logrus" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" - "go.k6.io/k6/usage" ) // A Compiler compiles JavaScript or TypeScript source code into a sobek.Program diff --git a/js/compiler/compiler_test.go b/internal/js/compiler/compiler_test.go similarity index 99% rename from js/compiler/compiler_test.go rename to internal/js/compiler/compiler_test.go index fc8739d79d9..3702c7f5969 100644 --- a/js/compiler/compiler_test.go +++ b/internal/js/compiler/compiler_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" ) func TestCompile(t *testing.T) { diff --git a/js/compiler/enhanced.go b/internal/js/compiler/enhanced.go similarity index 100% rename from js/compiler/enhanced.go rename to internal/js/compiler/enhanced.go diff --git a/js/compiler/enhanced_test.go b/internal/js/compiler/enhanced_test.go similarity index 98% rename from js/compiler/enhanced_test.go rename to internal/js/compiler/enhanced_test.go index a249fb8cdde..9fd53e3fa03 100644 --- a/js/compiler/enhanced_test.go +++ b/internal/js/compiler/enhanced_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" ) func Test_esbuildTransform_js(t *testing.T) { diff --git a/js/console.go b/internal/js/console.go similarity index 100% rename from js/console.go rename to internal/js/console.go diff --git a/js/console_test.go b/internal/js/console_test.go similarity index 99% rename from js/console_test.go rename to internal/js/console_test.go index a99cdcb23b8..93726b2e23c 100644 --- a/js/console_test.go +++ b/internal/js/console_test.go @@ -15,13 +15,13 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/js/common" "go.k6.io/k6/lib" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) func TestConsoleContext(t *testing.T) { diff --git a/js/doc.go b/internal/js/doc.go similarity index 100% rename from js/doc.go rename to internal/js/doc.go diff --git a/js/empty_iterations_bench_test.go b/internal/js/empty_iterations_bench_test.go similarity index 100% rename from js/empty_iterations_bench_test.go rename to internal/js/empty_iterations_bench_test.go diff --git a/js/esm_vs_commonjs_test.go b/internal/js/esm_vs_commonjs_test.go similarity index 100% rename from js/esm_vs_commonjs_test.go rename to internal/js/esm_vs_commonjs_test.go diff --git a/js/eventloop/eventloop.go b/internal/js/eventloop/eventloop.go similarity index 100% rename from js/eventloop/eventloop.go rename to internal/js/eventloop/eventloop.go diff --git a/js/eventloop/eventloop_test.go b/internal/js/eventloop/eventloop_test.go similarity index 95% rename from js/eventloop/eventloop_test.go rename to internal/js/eventloop/eventloop_test.go index 085c1cfcd13..ed4f87877d1 100644 --- a/js/eventloop/eventloop_test.go +++ b/internal/js/eventloop/eventloop_test.go @@ -9,8 +9,8 @@ import ( "github.com/grafana/sobek" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/js/eventloop" "go.k6.io/k6/js/common" - "go.k6.io/k6/js/eventloop" "go.k6.io/k6/js/modulestest" ) @@ -199,7 +199,7 @@ func TestEventLoopRejectGoError(t *testing.T) { return err }) loop.WaitOnRegistered() - require.EqualError(t, err, "Uncaught (in promise) GoError: some error\n\tat go.k6.io/k6/js/eventloop_test.TestEventLoopRejectGoError.func1 (native)\n\tat :1:31(2)\n") + require.EqualError(t, err, "Uncaught (in promise) GoError: some error\n\tat go.k6.io/k6/internal/js/eventloop_test.TestEventLoopRejectGoError.func1 (native)\n\tat :1:31(2)\n") } func TestEventLoopRejectThrow(t *testing.T) { @@ -216,7 +216,7 @@ func TestEventLoopRejectThrow(t *testing.T) { return err }) loop.WaitOnRegistered() - require.EqualError(t, err, "Uncaught (in promise) GoError: throw error\n\tat go.k6.io/k6/js/eventloop_test.TestEventLoopRejectThrow.func1 (native)\n\tat :1:31(2)\n") + require.EqualError(t, err, "Uncaught (in promise) GoError: throw error\n\tat go.k6.io/k6/internal/js/eventloop_test.TestEventLoopRejectThrow.func1 (native)\n\tat :1:31(2)\n") } func TestEventLoopAsyncAwait(t *testing.T) { diff --git a/js/http_bench_test.go b/internal/js/http_bench_test.go similarity index 97% rename from js/http_bench_test.go rename to internal/js/http_bench_test.go index f97f4f22bec..2bf7f335a09 100644 --- a/js/http_bench_test.go +++ b/internal/js/http_bench_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils/httpmultibin" "go.k6.io/k6/metrics" ) diff --git a/js/init_and_modules_test.go b/internal/js/init_and_modules_test.go similarity index 96% rename from js/init_and_modules_test.go rename to internal/js/init_and_modules_test.go index 257644aae23..1ca01920d30 100644 --- a/js/init_and_modules_test.go +++ b/internal/js/init_and_modules_test.go @@ -12,14 +12,14 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" - "go.k6.io/k6/js" + "go.k6.io/k6/internal/js" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/js/modules" "go.k6.io/k6/lib" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) type CheckModule struct { diff --git a/js/initcontext.go b/internal/js/initcontext.go similarity index 98% rename from js/initcontext.go rename to internal/js/initcontext.go index 80cd7903c06..b4997b3d972 100644 --- a/js/initcontext.go +++ b/internal/js/initcontext.go @@ -8,8 +8,8 @@ import ( "github.com/grafana/sobek" "github.com/sirupsen/logrus" + "go.k6.io/k6/internal/loader" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/loader" ) const cantBeUsedOutsideInitContextMsg = `the "%s" function is only available in the init stage ` + diff --git a/js/initcontext_test.go b/internal/js/initcontext_test.go similarity index 100% rename from js/initcontext_test.go rename to internal/js/initcontext_test.go diff --git a/js/jsmodules.go b/internal/js/jsmodules.go similarity index 81% rename from js/jsmodules.go rename to internal/js/jsmodules.go index fb8446bc90b..ad48ce4cacc 100644 --- a/js/jsmodules.go +++ b/internal/js/jsmodules.go @@ -5,26 +5,26 @@ import ( "sync" "go.k6.io/k6/ext" + "go.k6.io/k6/internal/js/modules/k6/browser/browser" + "go.k6.io/k6/internal/js/modules/k6/crypto" + "go.k6.io/k6/internal/js/modules/k6/crypto/x509" + "go.k6.io/k6/internal/js/modules/k6/data" + "go.k6.io/k6/internal/js/modules/k6/encoding" + "go.k6.io/k6/internal/js/modules/k6/execution" + "go.k6.io/k6/internal/js/modules/k6/experimental/csv" + "go.k6.io/k6/internal/js/modules/k6/experimental/fs" + "go.k6.io/k6/internal/js/modules/k6/experimental/streams" + expws "go.k6.io/k6/internal/js/modules/k6/experimental/websockets" + "go.k6.io/k6/internal/js/modules/k6/grpc" + "go.k6.io/k6/internal/js/modules/k6/metrics" + "go.k6.io/k6/internal/js/modules/k6/timers" + "go.k6.io/k6/internal/js/modules/k6/webcrypto" + "go.k6.io/k6/internal/js/modules/k6/ws" "go.k6.io/k6/js/common" "go.k6.io/k6/js/modules" "go.k6.io/k6/js/modules/k6" - "go.k6.io/k6/js/modules/k6/browser/browser" - "go.k6.io/k6/js/modules/k6/crypto" - "go.k6.io/k6/js/modules/k6/crypto/x509" - "go.k6.io/k6/js/modules/k6/data" - "go.k6.io/k6/js/modules/k6/encoding" - "go.k6.io/k6/js/modules/k6/execution" - "go.k6.io/k6/js/modules/k6/experimental/csv" - "go.k6.io/k6/js/modules/k6/experimental/fs" - "go.k6.io/k6/js/modules/k6/experimental/streams" - expws "go.k6.io/k6/js/modules/k6/experimental/websockets" - "go.k6.io/k6/js/modules/k6/grpc" "go.k6.io/k6/js/modules/k6/html" "go.k6.io/k6/js/modules/k6/http" - "go.k6.io/k6/js/modules/k6/metrics" - "go.k6.io/k6/js/modules/k6/timers" - "go.k6.io/k6/js/modules/k6/webcrypto" - "go.k6.io/k6/js/modules/k6/ws" "github.com/grafana/xk6-redis/redis" ) diff --git a/js/module_loading_test.go b/internal/js/module_loading_test.go similarity index 99% rename from js/module_loading_test.go rename to internal/js/module_loading_test.go index 060eb4c4e50..0211c52023e 100644 --- a/js/module_loading_test.go +++ b/internal/js/module_loading_test.go @@ -13,8 +13,8 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils/httpmultibin" "go.k6.io/k6/metrics" ) diff --git a/js/modules/k6/browser/browser/browser_context_mapping.go b/internal/js/modules/k6/browser/browser/browser_context_mapping.go similarity index 97% rename from js/modules/k6/browser/browser/browser_context_mapping.go rename to internal/js/modules/k6/browser/browser/browser_context_mapping.go index 68161a74df5..41de74a884b 100644 --- a/js/modules/k6/browser/browser/browser_context_mapping.go +++ b/internal/js/modules/k6/browser/browser/browser_context_mapping.go @@ -8,9 +8,9 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6error" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6error" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapBrowserContext to the JS module. diff --git a/js/modules/k6/browser/browser/browser_context_options_test.go b/internal/js/modules/k6/browser/browser/browser_context_options_test.go similarity index 97% rename from js/modules/k6/browser/browser/browser_context_options_test.go rename to internal/js/modules/k6/browser/browser/browser_context_options_test.go index 5b33ee4686b..ef486a16abf 100644 --- a/js/modules/k6/browser/browser/browser_context_options_test.go +++ b/internal/js/modules/k6/browser/browser/browser_context_options_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" ) func TestBrowserContextOptionsPermissions(t *testing.T) { diff --git a/js/modules/k6/browser/browser/browser_mapping.go b/internal/js/modules/k6/browser/browser/browser_mapping.go similarity index 96% rename from js/modules/k6/browser/browser/browser_mapping.go rename to internal/js/modules/k6/browser/browser/browser_mapping.go index d615faed9c2..42ccf187981 100644 --- a/js/modules/k6/browser/browser/browser_mapping.go +++ b/internal/js/modules/k6/browser/browser/browser_mapping.go @@ -5,8 +5,8 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapBrowser to the JS module. diff --git a/js/modules/k6/browser/browser/console_message_mapping.go b/internal/js/modules/k6/browser/browser/console_message_mapping.go similarity index 92% rename from js/modules/k6/browser/browser/console_message_mapping.go rename to internal/js/modules/k6/browser/browser/console_message_mapping.go index 93bf21189c7..75663c9e69a 100644 --- a/js/modules/k6/browser/browser/console_message_mapping.go +++ b/internal/js/modules/k6/browser/browser/console_message_mapping.go @@ -1,7 +1,7 @@ package browser import ( - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) // mapConsoleMessage to the JS module. diff --git a/js/modules/k6/browser/browser/element_handle_mapping.go b/internal/js/modules/k6/browser/browser/element_handle_mapping.go similarity index 98% rename from js/modules/k6/browser/browser/element_handle_mapping.go rename to internal/js/modules/k6/browser/browser/element_handle_mapping.go index 856834f70ba..be8095615e2 100644 --- a/js/modules/k6/browser/browser/element_handle_mapping.go +++ b/internal/js/modules/k6/browser/browser/element_handle_mapping.go @@ -5,8 +5,8 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapElementHandle to the JS module. diff --git a/js/modules/k6/browser/browser/file_persister.go b/internal/js/modules/k6/browser/browser/file_persister.go similarity index 96% rename from js/modules/k6/browser/browser/file_persister.go rename to internal/js/modules/k6/browser/browser/file_persister.go index 92a1fad824f..510830f91a7 100644 --- a/js/modules/k6/browser/browser/file_persister.go +++ b/internal/js/modules/k6/browser/browser/file_persister.go @@ -6,8 +6,8 @@ import ( "net/url" "strings" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/storage" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/storage" ) type presignedURLConfig struct { diff --git a/js/modules/k6/browser/browser/file_persister_test.go b/internal/js/modules/k6/browser/browser/file_persister_test.go similarity index 97% rename from js/modules/k6/browser/browser/file_persister_test.go rename to internal/js/modules/k6/browser/browser/file_persister_test.go index 1fe40ad6111..54f38f92c80 100644 --- a/js/modules/k6/browser/browser/file_persister_test.go +++ b/internal/js/modules/k6/browser/browser/file_persister_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/storage" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/storage" ) func Test_newScreenshotPersister(t *testing.T) { diff --git a/js/modules/k6/browser/browser/frame_mapping.go b/internal/js/modules/k6/browser/browser/frame_mapping.go similarity index 99% rename from js/modules/k6/browser/browser/frame_mapping.go rename to internal/js/modules/k6/browser/browser/frame_mapping.go index c67051358ac..8547388d624 100644 --- a/js/modules/k6/browser/browser/frame_mapping.go +++ b/internal/js/modules/k6/browser/browser/frame_mapping.go @@ -5,8 +5,8 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapFrame to the JS module. diff --git a/js/modules/k6/browser/browser/helpers.go b/internal/js/modules/k6/browser/browser/helpers.go similarity index 94% rename from js/modules/k6/browser/browser/helpers.go rename to internal/js/modules/k6/browser/browser/helpers.go index 3d2056735ff..3559457f6dd 100644 --- a/js/modules/k6/browser/browser/helpers.go +++ b/internal/js/modules/k6/browser/browser/helpers.go @@ -7,8 +7,8 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/k6error" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6error" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) func panicIfFatalError(ctx context.Context, err error) { diff --git a/js/modules/k6/browser/browser/helpers_test.go b/internal/js/modules/k6/browser/browser/helpers_test.go similarity index 100% rename from js/modules/k6/browser/browser/helpers_test.go rename to internal/js/modules/k6/browser/browser/helpers_test.go diff --git a/js/modules/k6/browser/browser/js_handle_mapping.go b/internal/js/modules/k6/browser/browser/js_handle_mapping.go similarity index 94% rename from js/modules/k6/browser/browser/js_handle_mapping.go rename to internal/js/modules/k6/browser/browser/js_handle_mapping.go index e66864a57de..cc805a971d6 100644 --- a/js/modules/k6/browser/browser/js_handle_mapping.go +++ b/internal/js/modules/k6/browser/browser/js_handle_mapping.go @@ -5,8 +5,8 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapJSHandle to the JS module. diff --git a/js/modules/k6/browser/browser/keyboard_mapping.go b/internal/js/modules/k6/browser/browser/keyboard_mapping.go similarity index 92% rename from js/modules/k6/browser/browser/keyboard_mapping.go rename to internal/js/modules/k6/browser/browser/keyboard_mapping.go index dbbc8176413..dab345509a7 100644 --- a/js/modules/k6/browser/browser/keyboard_mapping.go +++ b/internal/js/modules/k6/browser/browser/keyboard_mapping.go @@ -5,8 +5,8 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) func mapKeyboard(vu moduleVU, kb *common.Keyboard) mapping { diff --git a/js/modules/k6/browser/browser/locator_mapping.go b/internal/js/modules/k6/browser/browser/locator_mapping.go similarity index 98% rename from js/modules/k6/browser/browser/locator_mapping.go rename to internal/js/modules/k6/browser/browser/locator_mapping.go index 6204c044344..a822a832033 100644 --- a/js/modules/k6/browser/browser/locator_mapping.go +++ b/internal/js/modules/k6/browser/browser/locator_mapping.go @@ -5,8 +5,8 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapLocator API to the JS module. diff --git a/js/modules/k6/browser/browser/mapping.go b/internal/js/modules/k6/browser/browser/mapping.go similarity index 95% rename from js/modules/k6/browser/browser/mapping.go rename to internal/js/modules/k6/browser/browser/mapping.go index 166f51380c3..50aabd58ea5 100644 --- a/js/modules/k6/browser/browser/mapping.go +++ b/internal/js/modules/k6/browser/browser/mapping.go @@ -7,7 +7,7 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" k6common "go.k6.io/k6/js/common" ) diff --git a/js/modules/k6/browser/browser/mapping_test.go b/internal/js/modules/k6/browser/browser/mapping_test.go similarity index 99% rename from js/modules/k6/browser/browser/mapping_test.go rename to internal/js/modules/k6/browser/browser/mapping_test.go index 46f4ffa3f81..b5c9f35b6be 100644 --- a/js/modules/k6/browser/browser/mapping_test.go +++ b/internal/js/modules/k6/browser/browser/mapping_test.go @@ -9,7 +9,7 @@ import ( "github.com/grafana/sobek" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" k6common "go.k6.io/k6/js/common" k6modulestest "go.k6.io/k6/js/modulestest" diff --git a/js/modules/k6/browser/browser/metric_event_mapping.go b/internal/js/modules/k6/browser/browser/metric_event_mapping.go similarity index 91% rename from js/modules/k6/browser/browser/metric_event_mapping.go rename to internal/js/modules/k6/browser/browser/metric_event_mapping.go index b8c66ea5ff4..851ed06b2cc 100644 --- a/js/modules/k6/browser/browser/metric_event_mapping.go +++ b/internal/js/modules/k6/browser/browser/metric_event_mapping.go @@ -3,7 +3,7 @@ package browser import ( "fmt" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) // mapMetricEvent to the JS module. diff --git a/js/modules/k6/browser/browser/module.go b/internal/js/modules/k6/browser/browser/module.go similarity index 96% rename from js/modules/k6/browser/browser/module.go rename to internal/js/modules/k6/browser/browser/module.go index 20c6f92915a..3bec7e085d9 100644 --- a/js/modules/k6/browser/browser/module.go +++ b/internal/js/modules/k6/browser/browser/module.go @@ -16,9 +16,9 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" k6modules "go.k6.io/k6/js/modules" ) diff --git a/js/modules/k6/browser/browser/module_test.go b/internal/js/modules/k6/browser/browser/module_test.go similarity index 92% rename from js/modules/k6/browser/browser/module_test.go rename to internal/js/modules/k6/browser/browser/module_test.go index 2eec055aead..25d3b26a7b2 100644 --- a/js/modules/k6/browser/browser/module_test.go +++ b/internal/js/modules/k6/browser/browser/module_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" ) // TestModuleNew tests registering the module. diff --git a/js/modules/k6/browser/browser/modulevu.go b/internal/js/modules/k6/browser/browser/modulevu.go similarity index 89% rename from js/modules/k6/browser/browser/modulevu.go rename to internal/js/modules/k6/browser/browser/modulevu.go index 4ec2b6d3912..d06c61d6c8c 100644 --- a/js/modules/k6/browser/browser/modulevu.go +++ b/internal/js/modules/k6/browser/browser/modulevu.go @@ -3,8 +3,8 @@ package browser import ( "context" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" k6modules "go.k6.io/k6/js/modules" ) diff --git a/js/modules/k6/browser/browser/mouse_mapping.go b/internal/js/modules/k6/browser/browser/mouse_mapping.go similarity index 91% rename from js/modules/k6/browser/browser/mouse_mapping.go rename to internal/js/modules/k6/browser/browser/mouse_mapping.go index 5fd24b22851..16514ed576b 100644 --- a/js/modules/k6/browser/browser/mouse_mapping.go +++ b/internal/js/modules/k6/browser/browser/mouse_mapping.go @@ -3,8 +3,8 @@ package browser import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) func mapMouse(vu moduleVU, m *common.Mouse) mapping { diff --git a/js/modules/k6/browser/browser/page_mapping.go b/internal/js/modules/k6/browser/browser/page_mapping.go similarity index 99% rename from js/modules/k6/browser/browser/page_mapping.go rename to internal/js/modules/k6/browser/browser/page_mapping.go index 0d2e70f3dba..3ec6652a63a 100644 --- a/js/modules/k6/browser/browser/page_mapping.go +++ b/internal/js/modules/k6/browser/browser/page_mapping.go @@ -8,8 +8,8 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapPage to the JS module. diff --git a/js/modules/k6/browser/browser/registry.go b/internal/js/modules/k6/browser/browser/registry.go similarity index 97% rename from js/modules/k6/browser/browser/registry.go rename to internal/js/modules/k6/browser/browser/registry.go index 255a22a0c22..e459ffab311 100644 --- a/js/modules/k6/browser/browser/registry.go +++ b/internal/js/modules/k6/browser/browser/registry.go @@ -16,13 +16,13 @@ import ( "go.opentelemetry.io/otel/attribute" oteltrace "go.opentelemetry.io/otel/trace" - "go.k6.io/k6/js/modules/k6/browser/chromium" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - browsertrace "go.k6.io/k6/js/modules/k6/browser/trace" + "go.k6.io/k6/internal/js/modules/k6/browser/chromium" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + browsertrace "go.k6.io/k6/internal/js/modules/k6/browser/trace" - k6event "go.k6.io/k6/event" + k6event "go.k6.io/k6/internal/event" k6modules "go.k6.io/k6/js/modules" ) diff --git a/js/modules/k6/browser/browser/registry_test.go b/internal/js/modules/k6/browser/browser/registry_test.go similarity index 98% rename from js/modules/k6/browser/browser/registry_test.go rename to internal/js/modules/k6/browser/browser/registry_test.go index 16afd4d8e56..99f5be946d1 100644 --- a/js/modules/k6/browser/browser/registry_test.go +++ b/internal/js/modules/k6/browser/browser/registry_test.go @@ -10,10 +10,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" - k6event "go.k6.io/k6/event" + k6event "go.k6.io/k6/internal/event" ) func TestPidRegistry(t *testing.T) { diff --git a/js/modules/k6/browser/browser/request_mapping.go b/internal/js/modules/k6/browser/browser/request_mapping.go similarity index 93% rename from js/modules/k6/browser/browser/request_mapping.go rename to internal/js/modules/k6/browser/browser/request_mapping.go index e4f50ddb629..3a1c3dd8a0b 100644 --- a/js/modules/k6/browser/browser/request_mapping.go +++ b/internal/js/modules/k6/browser/browser/request_mapping.go @@ -3,8 +3,8 @@ package browser import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapRequest to the JS module. diff --git a/js/modules/k6/browser/browser/response_mapping.go b/internal/js/modules/k6/browser/browser/response_mapping.go similarity index 95% rename from js/modules/k6/browser/browser/response_mapping.go rename to internal/js/modules/k6/browser/browser/response_mapping.go index 68aa48136cb..0c9373910ae 100644 --- a/js/modules/k6/browser/browser/response_mapping.go +++ b/internal/js/modules/k6/browser/browser/response_mapping.go @@ -3,8 +3,8 @@ package browser import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapResponse to the JS module. diff --git a/js/modules/k6/browser/browser/touchscreen_mapping.go b/internal/js/modules/k6/browser/browser/touchscreen_mapping.go similarity index 77% rename from js/modules/k6/browser/browser/touchscreen_mapping.go rename to internal/js/modules/k6/browser/browser/touchscreen_mapping.go index f4804c88a73..b34644a09e4 100644 --- a/js/modules/k6/browser/browser/touchscreen_mapping.go +++ b/internal/js/modules/k6/browser/browser/touchscreen_mapping.go @@ -3,8 +3,8 @@ package browser import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // mapTouchscreen to the JS module. diff --git a/js/modules/k6/browser/browser/worker_mapping.go b/internal/js/modules/k6/browser/browser/worker_mapping.go similarity index 74% rename from js/modules/k6/browser/browser/worker_mapping.go rename to internal/js/modules/k6/browser/browser/worker_mapping.go index 2c6c06ed1a8..587ce6b6192 100644 --- a/js/modules/k6/browser/browser/worker_mapping.go +++ b/internal/js/modules/k6/browser/browser/worker_mapping.go @@ -1,7 +1,7 @@ package browser import ( - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) // mapWorker to the JS module. diff --git a/js/modules/k6/browser/chromium/browser.go b/internal/js/modules/k6/browser/chromium/browser.go similarity index 85% rename from js/modules/k6/browser/chromium/browser.go rename to internal/js/modules/k6/browser/chromium/browser.go index b4a0e466cba..9b95b3f2af9 100644 --- a/js/modules/k6/browser/chromium/browser.go +++ b/internal/js/modules/k6/browser/chromium/browser.go @@ -2,7 +2,7 @@ package chromium import ( - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) // Browser is the public interface of a CDP browser. diff --git a/js/modules/k6/browser/chromium/browser_type.go b/internal/js/modules/k6/browser/chromium/browser_type.go similarity index 98% rename from js/modules/k6/browser/chromium/browser_type.go rename to internal/js/modules/k6/browser/chromium/browser_type.go index df6e5b67de5..f8788fc9772 100644 --- a/js/modules/k6/browser/chromium/browser_type.go +++ b/internal/js/modules/k6/browser/chromium/browser_type.go @@ -12,11 +12,11 @@ import ( "strings" "time" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/log" - "go.k6.io/k6/js/modules/k6/browser/storage" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/storage" k6modules "go.k6.io/k6/js/modules" k6lib "go.k6.io/k6/lib" diff --git a/js/modules/k6/browser/chromium/browser_type_test.go b/internal/js/modules/k6/browser/chromium/browser_type_test.go similarity index 98% rename from js/modules/k6/browser/chromium/browser_type_test.go rename to internal/js/modules/k6/browser/chromium/browser_type_test.go index dca92b307d4..dd8947c93d2 100644 --- a/js/modules/k6/browser/chromium/browser_type_test.go +++ b/internal/js/modules/k6/browser/chromium/browser_type_test.go @@ -7,8 +7,8 @@ import ( "sort" "testing" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/env" k6lib "go.k6.io/k6/lib" k6types "go.k6.io/k6/lib/types" diff --git a/js/modules/k6/browser/common/barrier.go b/internal/js/modules/k6/browser/common/barrier.go similarity index 100% rename from js/modules/k6/browser/common/barrier.go rename to internal/js/modules/k6/browser/common/barrier.go diff --git a/js/modules/k6/browser/common/barrier_test.go b/internal/js/modules/k6/browser/common/barrier_test.go similarity index 92% rename from js/modules/k6/browser/common/barrier_test.go rename to internal/js/modules/k6/browser/common/barrier_test.go index 41291056320..1a8e647e99b 100644 --- a/js/modules/k6/browser/common/barrier_test.go +++ b/internal/js/modules/k6/browser/common/barrier_test.go @@ -7,7 +7,7 @@ import ( "github.com/chromedp/cdproto/cdp" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) func TestBarrier(t *testing.T) { diff --git a/js/modules/k6/browser/common/browser.go b/internal/js/modules/k6/browser/common/browser.go similarity index 99% rename from js/modules/k6/browser/common/browser.go rename to internal/js/modules/k6/browser/common/browser.go index c0f167a2b95..b08e6b65396 100644 --- a/js/modules/k6/browser/common/browser.go +++ b/internal/js/modules/k6/browser/common/browser.go @@ -15,8 +15,8 @@ import ( "github.com/chromedp/cdproto/target" "github.com/gorilla/websocket" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) const ( diff --git a/js/modules/k6/browser/common/browser_context.go b/internal/js/modules/k6/browser/common/browser_context.go similarity index 99% rename from js/modules/k6/browser/common/browser_context.go rename to internal/js/modules/k6/browser/common/browser_context.go index c051cb86951..e8588cfcd58 100644 --- a/js/modules/k6/browser/common/browser_context.go +++ b/internal/js/modules/k6/browser/common/browser_context.go @@ -14,10 +14,10 @@ import ( "github.com/chromedp/cdproto/storage" "github.com/chromedp/cdproto/target" - "go.k6.io/k6/js/modules/k6/browser/common/js" - "go.k6.io/k6/js/modules/k6/browser/k6error" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/common/js" + "go.k6.io/k6/internal/js/modules/k6/browser/k6error" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/log" k6modules "go.k6.io/k6/js/modules" ) diff --git a/js/modules/k6/browser/common/browser_context_options.go b/internal/js/modules/k6/browser/common/browser_context_options.go similarity index 100% rename from js/modules/k6/browser/common/browser_context_options.go rename to internal/js/modules/k6/browser/common/browser_context_options.go diff --git a/js/modules/k6/browser/common/browser_context_test.go b/internal/js/modules/k6/browser/common/browser_context_test.go similarity index 96% rename from js/modules/k6/browser/common/browser_context_test.go rename to internal/js/modules/k6/browser/common/browser_context_test.go index a78ce2a78a7..2589f2f6efb 100644 --- a/js/modules/k6/browser/common/browser_context_test.go +++ b/internal/js/modules/k6/browser/common/browser_context_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common/js" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/common/js" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) func TestNewBrowserContext(t *testing.T) { diff --git a/js/modules/k6/browser/common/browser_options.go b/internal/js/modules/k6/browser/common/browser_options.go similarity index 97% rename from js/modules/k6/browser/common/browser_options.go rename to internal/js/modules/k6/browser/common/browser_options.go index 805f231096c..567e3aad39f 100644 --- a/js/modules/k6/browser/common/browser_options.go +++ b/internal/js/modules/k6/browser/common/browser_options.go @@ -8,8 +8,8 @@ import ( "strings" "time" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/log" "go.k6.io/k6/lib/types" ) diff --git a/js/modules/k6/browser/common/browser_options_test.go b/internal/js/modules/k6/browser/common/browser_options_test.go similarity index 97% rename from js/modules/k6/browser/common/browser_options_test.go rename to internal/js/modules/k6/browser/common/browser_options_test.go index 99ee249f783..02ebbe1595c 100644 --- a/js/modules/k6/browser/common/browser_options_test.go +++ b/internal/js/modules/k6/browser/common/browser_options_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) func TestBrowserOptionsParse(t *testing.T) { diff --git a/js/modules/k6/browser/common/browser_process.go b/internal/js/modules/k6/browser/common/browser_process.go similarity index 98% rename from js/modules/k6/browser/common/browser_process.go rename to internal/js/modules/k6/browser/common/browser_process.go index 433f40b0543..33c7ef10327 100644 --- a/js/modules/k6/browser/common/browser_process.go +++ b/internal/js/modules/k6/browser/common/browser_process.go @@ -11,8 +11,8 @@ import ( "os/exec" "strings" - "go.k6.io/k6/js/modules/k6/browser/log" - "go.k6.io/k6/js/modules/k6/browser/storage" + "go.k6.io/k6/internal/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/storage" ) type BrowserProcess struct { diff --git a/js/modules/k6/browser/common/browser_process_meta.go b/internal/js/modules/k6/browser/common/browser_process_meta.go similarity index 97% rename from js/modules/k6/browser/common/browser_process_meta.go rename to internal/js/modules/k6/browser/common/browser_process_meta.go index 8c74b7b3e1c..6af609d295a 100644 --- a/js/modules/k6/browser/common/browser_process_meta.go +++ b/internal/js/modules/k6/browser/common/browser_process_meta.go @@ -3,7 +3,7 @@ package common import ( "os" - "go.k6.io/k6/js/modules/k6/browser/storage" + "go.k6.io/k6/internal/js/modules/k6/browser/storage" ) const ( diff --git a/js/modules/k6/browser/common/browser_process_test.go b/internal/js/modules/k6/browser/common/browser_process_test.go similarity index 100% rename from js/modules/k6/browser/common/browser_process_test.go rename to internal/js/modules/k6/browser/common/browser_process_test.go diff --git a/js/modules/k6/browser/common/browser_test.go b/internal/js/modules/k6/browser/common/browser_test.go similarity index 97% rename from js/modules/k6/browser/common/browser_test.go rename to internal/js/modules/k6/browser/common/browser_test.go index 44042766061..2b103d50085 100644 --- a/js/modules/k6/browser/common/browser_test.go +++ b/internal/js/modules/k6/browser/common/browser_test.go @@ -11,9 +11,9 @@ import ( "github.com/mailru/easyjson" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) func TestBrowserNewPageInContext(t *testing.T) { diff --git a/js/modules/k6/browser/common/connection.go b/internal/js/modules/k6/browser/common/connection.go similarity index 99% rename from js/modules/k6/browser/common/connection.go rename to internal/js/modules/k6/browser/common/connection.go index 94e5271e7a8..7af08fb4900 100644 --- a/js/modules/k6/browser/common/connection.go +++ b/internal/js/modules/k6/browser/common/connection.go @@ -10,7 +10,7 @@ import ( "sync/atomic" "time" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/log" "github.com/chromedp/cdproto" "github.com/chromedp/cdproto/cdp" diff --git a/js/modules/k6/browser/common/connection_test.go b/internal/js/modules/k6/browser/common/connection_test.go similarity index 97% rename from js/modules/k6/browser/common/connection_test.go rename to internal/js/modules/k6/browser/common/connection_test.go index 1601612cb38..dddd4293e98 100644 --- a/js/modules/k6/browser/common/connection_test.go +++ b/internal/js/modules/k6/browser/common/connection_test.go @@ -6,8 +6,8 @@ import ( "net/url" "testing" - "go.k6.io/k6/js/modules/k6/browser/log" - "go.k6.io/k6/js/modules/k6/browser/tests/ws" + "go.k6.io/k6/internal/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/tests/ws" "github.com/chromedp/cdproto" "github.com/chromedp/cdproto/cdp" diff --git a/js/modules/k6/browser/common/consts.go b/internal/js/modules/k6/browser/common/consts.go similarity index 100% rename from js/modules/k6/browser/common/consts.go rename to internal/js/modules/k6/browser/common/consts.go diff --git a/js/modules/k6/browser/common/context.go b/internal/js/modules/k6/browser/common/context.go similarity index 100% rename from js/modules/k6/browser/common/context.go rename to internal/js/modules/k6/browser/common/context.go diff --git a/js/modules/k6/browser/common/context_test.go b/internal/js/modules/k6/browser/common/context_test.go similarity index 100% rename from js/modules/k6/browser/common/context_test.go rename to internal/js/modules/k6/browser/common/context_test.go diff --git a/js/modules/k6/browser/common/device.go b/internal/js/modules/k6/browser/common/device.go similarity index 100% rename from js/modules/k6/browser/common/device.go rename to internal/js/modules/k6/browser/common/device.go diff --git a/js/modules/k6/browser/common/doc.go b/internal/js/modules/k6/browser/common/doc.go similarity index 100% rename from js/modules/k6/browser/common/doc.go rename to internal/js/modules/k6/browser/common/doc.go diff --git a/js/modules/k6/browser/common/element_handle.go b/internal/js/modules/k6/browser/common/element_handle.go similarity index 99% rename from js/modules/k6/browser/common/element_handle.go rename to internal/js/modules/k6/browser/common/element_handle.go index 0a0469d11d3..6c19619747b 100644 --- a/js/modules/k6/browser/common/element_handle.go +++ b/internal/js/modules/k6/browser/common/element_handle.go @@ -15,8 +15,8 @@ import ( "github.com/grafana/sobek" "go.opentelemetry.io/otel/attribute" - "go.k6.io/k6/js/modules/k6/browser/common/js" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/common/js" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" k6common "go.k6.io/k6/js/common" ) diff --git a/js/modules/k6/browser/common/element_handle_options.go b/internal/js/modules/k6/browser/common/element_handle_options.go similarity index 99% rename from js/modules/k6/browser/common/element_handle_options.go rename to internal/js/modules/k6/browser/common/element_handle_options.go index cd803e3ba08..5fa0a752ab3 100644 --- a/js/modules/k6/browser/common/element_handle_options.go +++ b/internal/js/modules/k6/browser/common/element_handle_options.go @@ -9,7 +9,7 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) type ElementHandleBaseOptions struct { diff --git a/js/modules/k6/browser/common/element_handle_test.go b/internal/js/modules/k6/browser/common/element_handle_test.go similarity index 98% rename from js/modules/k6/browser/common/element_handle_test.go rename to internal/js/modules/k6/browser/common/element_handle_test.go index a0bb379600d..1ad59c6e1ce 100644 --- a/js/modules/k6/browser/common/element_handle_test.go +++ b/internal/js/modules/k6/browser/common/element_handle_test.go @@ -5,7 +5,7 @@ import ( "errors" "testing" - "go.k6.io/k6/js/modules/k6/browser/common/js" + "go.k6.io/k6/internal/js/modules/k6/browser/common/js" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/js/modules/k6/browser/common/errors.go b/internal/js/modules/k6/browser/common/errors.go similarity index 100% rename from js/modules/k6/browser/common/errors.go rename to internal/js/modules/k6/browser/common/errors.go diff --git a/js/modules/k6/browser/common/event_emitter.go b/internal/js/modules/k6/browser/common/event_emitter.go similarity index 100% rename from js/modules/k6/browser/common/event_emitter.go rename to internal/js/modules/k6/browser/common/event_emitter.go diff --git a/js/modules/k6/browser/common/event_emitter_test.go b/internal/js/modules/k6/browser/common/event_emitter_test.go similarity index 100% rename from js/modules/k6/browser/common/event_emitter_test.go rename to internal/js/modules/k6/browser/common/event_emitter_test.go diff --git a/js/modules/k6/browser/common/execution_context.go b/internal/js/modules/k6/browser/common/execution_context.go similarity index 98% rename from js/modules/k6/browser/common/execution_context.go rename to internal/js/modules/k6/browser/common/execution_context.go index 3dba28f0ed6..ece32a4cd2a 100644 --- a/js/modules/k6/browser/common/execution_context.go +++ b/internal/js/modules/k6/browser/common/execution_context.go @@ -8,8 +8,8 @@ import ( "regexp" "sync" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/log" k6modules "go.k6.io/k6/js/modules" diff --git a/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go similarity index 99% rename from js/modules/k6/browser/common/frame.go rename to internal/js/modules/k6/browser/common/frame.go index 2f54b90f702..3742c27ea29 100644 --- a/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -15,8 +15,8 @@ import ( "github.com/chromedp/cdproto/runtime" "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/log" k6modules "go.k6.io/k6/js/modules" ) diff --git a/js/modules/k6/browser/common/frame_manager.go b/internal/js/modules/k6/browser/common/frame_manager.go similarity index 99% rename from js/modules/k6/browser/common/frame_manager.go rename to internal/js/modules/k6/browser/common/frame_manager.go index ac4b052ae2d..742e0676ff5 100644 --- a/js/modules/k6/browser/common/frame_manager.go +++ b/internal/js/modules/k6/browser/common/frame_manager.go @@ -7,8 +7,8 @@ import ( "sync" "sync/atomic" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/log" k6modules "go.k6.io/k6/js/modules" diff --git a/js/modules/k6/browser/common/frame_options.go b/internal/js/modules/k6/browser/common/frame_options.go similarity index 99% rename from js/modules/k6/browser/common/frame_options.go rename to internal/js/modules/k6/browser/common/frame_options.go index f01278fef0f..aba1fd51333 100644 --- a/js/modules/k6/browser/common/frame_options.go +++ b/internal/js/modules/k6/browser/common/frame_options.go @@ -10,7 +10,7 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) type FrameBaseOptions struct { diff --git a/js/modules/k6/browser/common/frame_options_test.go b/internal/js/modules/k6/browser/common/frame_options_test.go similarity index 98% rename from js/modules/k6/browser/common/frame_options_test.go rename to internal/js/modules/k6/browser/common/frame_options_test.go index 5497cc04964..8b7ece0acfd 100644 --- a/js/modules/k6/browser/common/frame_options_test.go +++ b/internal/js/modules/k6/browser/common/frame_options_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/js/modules/k6/browser/common/frame_session.go b/internal/js/modules/k6/browser/common/frame_session.go similarity index 99% rename from js/modules/k6/browser/common/frame_session.go rename to internal/js/modules/k6/browser/common/frame_session.go index eba9dfcf88c..da3cb8855ef 100644 --- a/js/modules/k6/browser/common/frame_session.go +++ b/internal/js/modules/k6/browser/common/frame_session.go @@ -14,8 +14,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/log" k6modules "go.k6.io/k6/js/modules" k6metrics "go.k6.io/k6/metrics" diff --git a/js/modules/k6/browser/common/frame_test.go b/internal/js/modules/k6/browser/common/frame_test.go similarity index 96% rename from js/modules/k6/browser/common/frame_test.go rename to internal/js/modules/k6/browser/common/frame_test.go index 7c8d75a5367..9a112bdd8c2 100644 --- a/js/modules/k6/browser/common/frame_test.go +++ b/internal/js/modules/k6/browser/common/frame_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/log" "github.com/chromedp/cdproto/cdp" "github.com/stretchr/testify/require" diff --git a/js/modules/k6/browser/common/helpers.go b/internal/js/modules/k6/browser/common/helpers.go similarity index 99% rename from js/modules/k6/browser/common/helpers.go rename to internal/js/modules/k6/browser/common/helpers.go index 2a6f8175f18..fde4d145395 100644 --- a/js/modules/k6/browser/common/helpers.go +++ b/internal/js/modules/k6/browser/common/helpers.go @@ -11,7 +11,7 @@ import ( cdpruntime "github.com/chromedp/cdproto/runtime" "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) func convertBaseJSHandleTypes( diff --git a/js/modules/k6/browser/common/helpers_test.go b/internal/js/modules/k6/browser/common/helpers_test.go similarity index 99% rename from js/modules/k6/browser/common/helpers_test.go rename to internal/js/modules/k6/browser/common/helpers_test.go index 25f78e1cc5d..45f0cd85212 100644 --- a/js/modules/k6/browser/common/helpers_test.go +++ b/internal/js/modules/k6/browser/common/helpers_test.go @@ -11,7 +11,7 @@ import ( "github.com/chromedp/cdproto/runtime" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) func newExecCtx() (*ExecutionContext, context.Context) { diff --git a/js/modules/k6/browser/common/hooks.go b/internal/js/modules/k6/browser/common/hooks.go similarity index 100% rename from js/modules/k6/browser/common/hooks.go rename to internal/js/modules/k6/browser/common/hooks.go diff --git a/js/modules/k6/browser/common/http.go b/internal/js/modules/k6/browser/common/http.go similarity index 99% rename from js/modules/k6/browser/common/http.go rename to internal/js/modules/k6/browser/common/http.go index f83f245a66d..77b1a3e91bf 100644 --- a/js/modules/k6/browser/common/http.go +++ b/internal/js/modules/k6/browser/common/http.go @@ -14,8 +14,8 @@ import ( "github.com/chromedp/cdproto/cdp" "github.com/chromedp/cdproto/network" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/log" k6modules "go.k6.io/k6/js/modules" ) diff --git a/js/modules/k6/browser/common/http_test.go b/internal/js/modules/k6/browser/common/http_test.go similarity index 98% rename from js/modules/k6/browser/common/http_test.go rename to internal/js/modules/k6/browser/common/http_test.go index 8869a699c14..75ac03a8746 100644 --- a/js/modules/k6/browser/common/http_test.go +++ b/internal/js/modules/k6/browser/common/http_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) func TestRequest(t *testing.T) { diff --git a/js/modules/k6/browser/common/js/actions.go b/internal/js/modules/k6/browser/common/js/actions.go similarity index 100% rename from js/modules/k6/browser/common/js/actions.go rename to internal/js/modules/k6/browser/common/js/actions.go diff --git a/js/modules/k6/browser/common/js/doc.go b/internal/js/modules/k6/browser/common/js/doc.go similarity index 100% rename from js/modules/k6/browser/common/js/doc.go rename to internal/js/modules/k6/browser/common/js/doc.go diff --git a/js/modules/k6/browser/common/js/embedded_scripts.go b/internal/js/modules/k6/browser/common/js/embedded_scripts.go similarity index 100% rename from js/modules/k6/browser/common/js/embedded_scripts.go rename to internal/js/modules/k6/browser/common/js/embedded_scripts.go diff --git a/js/modules/k6/browser/common/js/injected_script.js b/internal/js/modules/k6/browser/common/js/injected_script.js similarity index 100% rename from js/modules/k6/browser/common/js/injected_script.js rename to internal/js/modules/k6/browser/common/js/injected_script.js diff --git a/js/modules/k6/browser/common/js/query_all.js b/internal/js/modules/k6/browser/common/js/query_all.js similarity index 100% rename from js/modules/k6/browser/common/js/query_all.js rename to internal/js/modules/k6/browser/common/js/query_all.js diff --git a/js/modules/k6/browser/common/js/scroll_into_view.js b/internal/js/modules/k6/browser/common/js/scroll_into_view.js similarity index 100% rename from js/modules/k6/browser/common/js/scroll_into_view.js rename to internal/js/modules/k6/browser/common/js/scroll_into_view.js diff --git a/js/modules/k6/browser/common/js/selectors.go b/internal/js/modules/k6/browser/common/js/selectors.go similarity index 100% rename from js/modules/k6/browser/common/js/selectors.go rename to internal/js/modules/k6/browser/common/js/selectors.go diff --git a/js/modules/k6/browser/common/js/web_vital_iife.js b/internal/js/modules/k6/browser/common/js/web_vital_iife.js similarity index 100% rename from js/modules/k6/browser/common/js/web_vital_iife.js rename to internal/js/modules/k6/browser/common/js/web_vital_iife.js diff --git a/js/modules/k6/browser/common/js/web_vital_init.js b/internal/js/modules/k6/browser/common/js/web_vital_init.js similarity index 100% rename from js/modules/k6/browser/common/js/web_vital_init.js rename to internal/js/modules/k6/browser/common/js/web_vital_init.js diff --git a/js/modules/k6/browser/common/js_handle.go b/internal/js/modules/k6/browser/common/js_handle.go similarity index 99% rename from js/modules/k6/browser/common/js_handle.go rename to internal/js/modules/k6/browser/common/js_handle.go index 81dd913d631..1b672babd74 100644 --- a/js/modules/k6/browser/common/js_handle.go +++ b/internal/js/modules/k6/browser/common/js_handle.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/log" "github.com/chromedp/cdproto/cdp" "github.com/chromedp/cdproto/runtime" diff --git a/js/modules/k6/browser/common/keyboard.go b/internal/js/modules/k6/browser/common/keyboard.go similarity index 99% rename from js/modules/k6/browser/common/keyboard.go rename to internal/js/modules/k6/browser/common/keyboard.go index 46aece9602c..607dec403bf 100644 --- a/js/modules/k6/browser/common/keyboard.go +++ b/internal/js/modules/k6/browser/common/keyboard.go @@ -10,7 +10,7 @@ import ( "github.com/chromedp/cdproto/cdp" "github.com/chromedp/cdproto/input" - "go.k6.io/k6/js/modules/k6/browser/keyboardlayout" + "go.k6.io/k6/internal/js/modules/k6/browser/keyboardlayout" ) const ( diff --git a/js/modules/k6/browser/common/keyboard_test.go b/internal/js/modules/k6/browser/common/keyboard_test.go similarity index 98% rename from js/modules/k6/browser/common/keyboard_test.go rename to internal/js/modules/k6/browser/common/keyboard_test.go index 3fbccfb8459..5f388cafbb5 100644 --- a/js/modules/k6/browser/common/keyboard_test.go +++ b/internal/js/modules/k6/browser/common/keyboard_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" - "go.k6.io/k6/js/modules/k6/browser/keyboardlayout" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/keyboardlayout" ) func TestSplit(t *testing.T) { diff --git a/js/modules/k6/browser/common/kill_linux.go b/internal/js/modules/k6/browser/common/kill_linux.go similarity index 100% rename from js/modules/k6/browser/common/kill_linux.go rename to internal/js/modules/k6/browser/common/kill_linux.go diff --git a/js/modules/k6/browser/common/kill_other.go b/internal/js/modules/k6/browser/common/kill_other.go similarity index 100% rename from js/modules/k6/browser/common/kill_other.go rename to internal/js/modules/k6/browser/common/kill_other.go diff --git a/js/modules/k6/browser/common/layout.go b/internal/js/modules/k6/browser/common/layout.go similarity index 98% rename from js/modules/k6/browser/common/layout.go rename to internal/js/modules/k6/browser/common/layout.go index 80abe45b04b..a1f69e4941e 100644 --- a/js/modules/k6/browser/common/layout.go +++ b/internal/js/modules/k6/browser/common/layout.go @@ -7,7 +7,7 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) // Position represents a position. diff --git a/js/modules/k6/browser/common/layout_test.go b/internal/js/modules/k6/browser/common/layout_test.go similarity index 100% rename from js/modules/k6/browser/common/layout_test.go rename to internal/js/modules/k6/browser/common/layout_test.go diff --git a/js/modules/k6/browser/common/lifecycle.go b/internal/js/modules/k6/browser/common/lifecycle.go similarity index 100% rename from js/modules/k6/browser/common/lifecycle.go rename to internal/js/modules/k6/browser/common/lifecycle.go diff --git a/js/modules/k6/browser/common/lifecycle_test.go b/internal/js/modules/k6/browser/common/lifecycle_test.go similarity index 100% rename from js/modules/k6/browser/common/lifecycle_test.go rename to internal/js/modules/k6/browser/common/lifecycle_test.go diff --git a/js/modules/k6/browser/common/locator.go b/internal/js/modules/k6/browser/common/locator.go similarity index 99% rename from js/modules/k6/browser/common/locator.go rename to internal/js/modules/k6/browser/common/locator.go index 09c70968cff..4a7b7c5fcab 100644 --- a/js/modules/k6/browser/common/locator.go +++ b/internal/js/modules/k6/browser/common/locator.go @@ -7,7 +7,7 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) // Strict mode: diff --git a/js/modules/k6/browser/common/mouse.go b/internal/js/modules/k6/browser/common/mouse.go similarity index 100% rename from js/modules/k6/browser/common/mouse.go rename to internal/js/modules/k6/browser/common/mouse.go diff --git a/js/modules/k6/browser/common/mouse_options.go b/internal/js/modules/k6/browser/common/mouse_options.go similarity index 98% rename from js/modules/k6/browser/common/mouse_options.go rename to internal/js/modules/k6/browser/common/mouse_options.go index bf99d4ca866..470bc920379 100644 --- a/js/modules/k6/browser/common/mouse_options.go +++ b/internal/js/modules/k6/browser/common/mouse_options.go @@ -5,7 +5,7 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) type MouseClickOptions struct { diff --git a/js/modules/k6/browser/common/network_manager.go b/internal/js/modules/k6/browser/common/network_manager.go similarity index 99% rename from js/modules/k6/browser/common/network_manager.go rename to internal/js/modules/k6/browser/common/network_manager.go index f44ae856d2f..8d9c2619a99 100644 --- a/js/modules/k6/browser/common/network_manager.go +++ b/internal/js/modules/k6/browser/common/network_manager.go @@ -11,9 +11,9 @@ import ( "sync" "time" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/log" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" k6modules "go.k6.io/k6/js/modules" k6lib "go.k6.io/k6/lib" diff --git a/js/modules/k6/browser/common/network_manager_test.go b/internal/js/modules/k6/browser/common/network_manager_test.go similarity index 97% rename from js/modules/k6/browser/common/network_manager_test.go rename to internal/js/modules/k6/browser/common/network_manager_test.go index ca3f8bfee7a..bf91603519f 100644 --- a/js/modules/k6/browser/common/network_manager_test.go +++ b/internal/js/modules/k6/browser/common/network_manager_test.go @@ -7,12 +7,12 @@ import ( "testing" "time" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/log" + k6mockresolver "go.k6.io/k6/internal/lib/testutils/mockresolver" k6lib "go.k6.io/k6/lib" - k6mockresolver "go.k6.io/k6/lib/testutils/mockresolver" k6types "go.k6.io/k6/lib/types" k6metrics "go.k6.io/k6/metrics" diff --git a/js/modules/k6/browser/common/network_profile.go b/internal/js/modules/k6/browser/common/network_profile.go similarity index 100% rename from js/modules/k6/browser/common/network_profile.go rename to internal/js/modules/k6/browser/common/network_profile.go diff --git a/js/modules/k6/browser/common/page.go b/internal/js/modules/k6/browser/common/page.go similarity index 99% rename from js/modules/k6/browser/common/page.go rename to internal/js/modules/k6/browser/common/page.go index 119b57799ae..4bfc1a810c4 100644 --- a/js/modules/k6/browser/common/page.go +++ b/internal/js/modules/k6/browser/common/page.go @@ -22,8 +22,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/log" k6modules "go.k6.io/k6/js/modules" ) diff --git a/js/modules/k6/browser/common/page_options.go b/internal/js/modules/k6/browser/common/page_options.go similarity index 98% rename from js/modules/k6/browser/common/page_options.go rename to internal/js/modules/k6/browser/common/page_options.go index 585c9389f3d..dcc696f5dce 100644 --- a/js/modules/k6/browser/common/page_options.go +++ b/internal/js/modules/k6/browser/common/page_options.go @@ -9,7 +9,7 @@ import ( "github.com/chromedp/cdproto/page" "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" ) type PageEmulateMediaOptions struct { diff --git a/js/modules/k6/browser/common/page_test.go b/internal/js/modules/k6/browser/common/page_test.go similarity index 100% rename from js/modules/k6/browser/common/page_test.go rename to internal/js/modules/k6/browser/common/page_test.go diff --git a/js/modules/k6/browser/common/remote_object.go b/internal/js/modules/k6/browser/common/remote_object.go similarity index 99% rename from js/modules/k6/browser/common/remote_object.go rename to internal/js/modules/k6/browser/common/remote_object.go index d86daf8a691..a91e76872d2 100644 --- a/js/modules/k6/browser/common/remote_object.go +++ b/internal/js/modules/k6/browser/common/remote_object.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/log" "github.com/chromedp/cdproto/runtime" ) diff --git a/js/modules/k6/browser/common/remote_object_test.go b/internal/js/modules/k6/browser/common/remote_object_test.go similarity index 99% rename from js/modules/k6/browser/common/remote_object_test.go rename to internal/js/modules/k6/browser/common/remote_object_test.go index 089aa675a9f..5852f9f6153 100644 --- a/js/modules/k6/browser/common/remote_object_test.go +++ b/internal/js/modules/k6/browser/common/remote_object_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" ) func TestValueFromRemoteObject(t *testing.T) { diff --git a/js/modules/k6/browser/common/screenshotter.go b/internal/js/modules/k6/browser/common/screenshotter.go similarity index 99% rename from js/modules/k6/browser/common/screenshotter.go rename to internal/js/modules/k6/browser/common/screenshotter.go index 609fe97dc05..15cbfeaa9ab 100644 --- a/js/modules/k6/browser/common/screenshotter.go +++ b/internal/js/modules/k6/browser/common/screenshotter.go @@ -13,7 +13,7 @@ import ( "github.com/chromedp/cdproto/cdp" "github.com/chromedp/cdproto/emulation" cdppage "github.com/chromedp/cdproto/page" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) // ScreenshotPersister is the type that all file persisters must implement. It's job is diff --git a/js/modules/k6/browser/common/selectors.go b/internal/js/modules/k6/browser/common/selectors.go similarity index 100% rename from js/modules/k6/browser/common/selectors.go rename to internal/js/modules/k6/browser/common/selectors.go diff --git a/js/modules/k6/browser/common/session.go b/internal/js/modules/k6/browser/common/session.go similarity index 99% rename from js/modules/k6/browser/common/session.go rename to internal/js/modules/k6/browser/common/session.go index d1b46cf86e0..2457661f778 100644 --- a/js/modules/k6/browser/common/session.go +++ b/internal/js/modules/k6/browser/common/session.go @@ -9,7 +9,7 @@ import ( "github.com/chromedp/cdproto/target" "github.com/mailru/easyjson" - "go.k6.io/k6/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/log" ) // Session represents a CDP session to a target. diff --git a/js/modules/k6/browser/common/session_test.go b/internal/js/modules/k6/browser/common/session_test.go similarity index 96% rename from js/modules/k6/browser/common/session_test.go rename to internal/js/modules/k6/browser/common/session_test.go index 963f68de4fc..1ce4e84800b 100644 --- a/js/modules/k6/browser/common/session_test.go +++ b/internal/js/modules/k6/browser/common/session_test.go @@ -6,8 +6,8 @@ import ( "net/url" "testing" - "go.k6.io/k6/js/modules/k6/browser/log" - "go.k6.io/k6/js/modules/k6/browser/tests/ws" + "go.k6.io/k6/internal/js/modules/k6/browser/log" + "go.k6.io/k6/internal/js/modules/k6/browser/tests/ws" "github.com/chromedp/cdproto" "github.com/chromedp/cdproto/cdp" diff --git a/js/modules/k6/browser/common/timeout.go b/internal/js/modules/k6/browser/common/timeout.go similarity index 100% rename from js/modules/k6/browser/common/timeout.go rename to internal/js/modules/k6/browser/common/timeout.go diff --git a/js/modules/k6/browser/common/timeout_test.go b/internal/js/modules/k6/browser/common/timeout_test.go similarity index 100% rename from js/modules/k6/browser/common/timeout_test.go rename to internal/js/modules/k6/browser/common/timeout_test.go diff --git a/js/modules/k6/browser/common/touchscreen.go b/internal/js/modules/k6/browser/common/touchscreen.go similarity index 100% rename from js/modules/k6/browser/common/touchscreen.go rename to internal/js/modules/k6/browser/common/touchscreen.go diff --git a/js/modules/k6/browser/common/trace.go b/internal/js/modules/k6/browser/common/trace.go similarity index 97% rename from js/modules/k6/browser/common/trace.go rename to internal/js/modules/k6/browser/common/trace.go index 1ce5ed10cce..2ce59633a2d 100644 --- a/js/modules/k6/browser/common/trace.go +++ b/internal/js/modules/k6/browser/common/trace.go @@ -6,7 +6,7 @@ import ( "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" - browsertrace "go.k6.io/k6/js/modules/k6/browser/trace" + browsertrace "go.k6.io/k6/internal/js/modules/k6/browser/trace" ) // Tracer defines the interface with the tracing methods used in the common package. diff --git a/js/modules/k6/browser/common/worker.go b/internal/js/modules/k6/browser/common/worker.go similarity index 100% rename from js/modules/k6/browser/common/worker.go rename to internal/js/modules/k6/browser/common/worker.go diff --git a/js/modules/k6/browser/env/env.go b/internal/js/modules/k6/browser/env/env.go similarity index 100% rename from js/modules/k6/browser/env/env.go rename to internal/js/modules/k6/browser/env/env.go diff --git a/js/modules/k6/browser/k6error/internal.go b/internal/js/modules/k6/browser/k6error/internal.go similarity index 100% rename from js/modules/k6/browser/k6error/internal.go rename to internal/js/modules/k6/browser/k6error/internal.go diff --git a/js/modules/k6/browser/k6ext/context.go b/internal/js/modules/k6/browser/k6ext/context.go similarity index 100% rename from js/modules/k6/browser/k6ext/context.go rename to internal/js/modules/k6/browser/k6ext/context.go diff --git a/js/modules/k6/browser/k6ext/doc.go b/internal/js/modules/k6/browser/k6ext/doc.go similarity index 100% rename from js/modules/k6/browser/k6ext/doc.go rename to internal/js/modules/k6/browser/k6ext/doc.go diff --git a/js/modules/k6/browser/k6ext/k6test/doc.go b/internal/js/modules/k6/browser/k6ext/k6test/doc.go similarity index 100% rename from js/modules/k6/browser/k6ext/k6test/doc.go rename to internal/js/modules/k6/browser/k6ext/k6test/doc.go diff --git a/js/modules/k6/browser/k6ext/k6test/executor.go b/internal/js/modules/k6/browser/k6ext/k6test/executor.go similarity index 100% rename from js/modules/k6/browser/k6ext/k6test/executor.go rename to internal/js/modules/k6/browser/k6ext/k6test/executor.go diff --git a/js/modules/k6/browser/k6ext/k6test/vu.go b/internal/js/modules/k6/browser/k6ext/k6test/vu.go similarity index 96% rename from js/modules/k6/browser/k6ext/k6test/vu.go rename to internal/js/modules/k6/browser/k6ext/k6test/vu.go index 83518adf708..0a0c71273bf 100644 --- a/js/modules/k6/browser/k6ext/k6test/vu.go +++ b/internal/js/modules/k6/browser/k6ext/k6test/vu.go @@ -9,17 +9,17 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" - "go.k6.io/k6/event" + "go.k6.io/k6/internal/event" + "go.k6.io/k6/internal/js/eventloop" + k6testutils "go.k6.io/k6/internal/lib/testutils" + k6trace "go.k6.io/k6/internal/lib/trace" k6common "go.k6.io/k6/js/common" - "go.k6.io/k6/js/eventloop" k6modulestest "go.k6.io/k6/js/modulestest" "go.k6.io/k6/lib" k6executor "go.k6.io/k6/lib/executor" - k6testutils "go.k6.io/k6/lib/testutils" - k6trace "go.k6.io/k6/lib/trace" k6metrics "go.k6.io/k6/metrics" ) diff --git a/js/modules/k6/browser/k6ext/metrics.go b/internal/js/modules/k6/browser/k6ext/metrics.go similarity index 100% rename from js/modules/k6/browser/k6ext/metrics.go rename to internal/js/modules/k6/browser/k6ext/metrics.go diff --git a/js/modules/k6/browser/k6ext/panic.go b/internal/js/modules/k6/browser/k6ext/panic.go similarity index 100% rename from js/modules/k6/browser/k6ext/panic.go rename to internal/js/modules/k6/browser/k6ext/panic.go diff --git a/js/modules/k6/browser/k6ext/promise.go b/internal/js/modules/k6/browser/k6ext/promise.go similarity index 100% rename from js/modules/k6/browser/k6ext/promise.go rename to internal/js/modules/k6/browser/k6ext/promise.go diff --git a/js/modules/k6/browser/keyboardlayout/layout.go b/internal/js/modules/k6/browser/keyboardlayout/layout.go similarity index 100% rename from js/modules/k6/browser/keyboardlayout/layout.go rename to internal/js/modules/k6/browser/keyboardlayout/layout.go diff --git a/js/modules/k6/browser/keyboardlayout/us.go b/internal/js/modules/k6/browser/keyboardlayout/us.go similarity index 100% rename from js/modules/k6/browser/keyboardlayout/us.go rename to internal/js/modules/k6/browser/keyboardlayout/us.go diff --git a/js/modules/k6/browser/log/logger.go b/internal/js/modules/k6/browser/log/logger.go similarity index 100% rename from js/modules/k6/browser/log/logger.go rename to internal/js/modules/k6/browser/log/logger.go diff --git a/js/modules/k6/browser/storage/file_persister.go b/internal/js/modules/k6/browser/storage/file_persister.go similarity index 100% rename from js/modules/k6/browser/storage/file_persister.go rename to internal/js/modules/k6/browser/storage/file_persister.go diff --git a/js/modules/k6/browser/storage/file_persister_test.go b/internal/js/modules/k6/browser/storage/file_persister_test.go similarity index 100% rename from js/modules/k6/browser/storage/file_persister_test.go rename to internal/js/modules/k6/browser/storage/file_persister_test.go diff --git a/js/modules/k6/browser/storage/storage.go b/internal/js/modules/k6/browser/storage/storage.go similarity index 100% rename from js/modules/k6/browser/storage/storage.go rename to internal/js/modules/k6/browser/storage/storage.go diff --git a/js/modules/k6/browser/storage/storage_test.go b/internal/js/modules/k6/browser/storage/storage_test.go similarity index 100% rename from js/modules/k6/browser/storage/storage_test.go rename to internal/js/modules/k6/browser/storage/storage_test.go diff --git a/js/modules/k6/browser/tests/browser_context_options_test.go b/internal/js/modules/k6/browser/tests/browser_context_options_test.go similarity index 98% rename from js/modules/k6/browser/tests/browser_context_options_test.go rename to internal/js/modules/k6/browser/tests/browser_context_options_test.go index 5b8814f80dc..6a741183413 100644 --- a/js/modules/k6/browser/tests/browser_context_options_test.go +++ b/internal/js/modules/k6/browser/tests/browser_context_options_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) func TestBrowserContextOptionsDefaultValues(t *testing.T) { diff --git a/js/modules/k6/browser/tests/browser_context_test.go b/internal/js/modules/k6/browser/tests/browser_context_test.go similarity index 99% rename from js/modules/k6/browser/tests/browser_context_test.go rename to internal/js/modules/k6/browser/tests/browser_context_test.go index 274e4bcba9b..95cee378fb6 100644 --- a/js/modules/k6/browser/tests/browser_context_test.go +++ b/internal/js/modules/k6/browser/tests/browser_context_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/env" ) func TestBrowserContextAddCookies(t *testing.T) { diff --git a/js/modules/k6/browser/tests/browser_test.go b/internal/js/modules/k6/browser/tests/browser_test.go similarity index 97% rename from js/modules/k6/browser/tests/browser_test.go rename to internal/js/modules/k6/browser/tests/browser_test.go index 8503e10ecca..52e13f6d2c0 100644 --- a/js/modules/k6/browser/tests/browser_test.go +++ b/internal/js/modules/k6/browser/tests/browser_test.go @@ -15,11 +15,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/browser" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/browser" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" ) func TestBrowserNewPage(t *testing.T) { diff --git a/js/modules/k6/browser/tests/browser_type_test.go b/internal/js/modules/k6/browser/tests/browser_type_test.go similarity index 87% rename from js/modules/k6/browser/tests/browser_type_test.go rename to internal/js/modules/k6/browser/tests/browser_type_test.go index 67907e1b10b..052c1b227c1 100644 --- a/js/modules/k6/browser/tests/browser_type_test.go +++ b/internal/js/modules/k6/browser/tests/browser_type_test.go @@ -6,10 +6,10 @@ import ( "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/browser" - "go.k6.io/k6/js/modules/k6/browser/chromium" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/browser" + "go.k6.io/k6/internal/js/modules/k6/browser/chromium" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" ) func TestBrowserTypeConnect(t *testing.T) { diff --git a/js/modules/k6/browser/tests/doc.go b/internal/js/modules/k6/browser/tests/doc.go similarity index 100% rename from js/modules/k6/browser/tests/doc.go rename to internal/js/modules/k6/browser/tests/doc.go diff --git a/js/modules/k6/browser/tests/element_handle_test.go b/internal/js/modules/k6/browser/tests/element_handle_test.go similarity index 99% rename from js/modules/k6/browser/tests/element_handle_test.go rename to internal/js/modules/k6/browser/tests/element_handle_test.go index 277ee175c32..65e9b36d517 100644 --- a/js/modules/k6/browser/tests/element_handle_test.go +++ b/internal/js/modules/k6/browser/tests/element_handle_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) //go:embed static/mouse_helper.js diff --git a/js/modules/k6/browser/tests/frame_manager_test.go b/internal/js/modules/k6/browser/tests/frame_manager_test.go similarity index 98% rename from js/modules/k6/browser/tests/frame_manager_test.go rename to internal/js/modules/k6/browser/tests/frame_manager_test.go index d3746588058..0f6ffb5ddab 100644 --- a/js/modules/k6/browser/tests/frame_manager_test.go +++ b/internal/js/modules/k6/browser/tests/frame_manager_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) func TestWaitForFrameNavigationWithinDocument(t *testing.T) { diff --git a/js/modules/k6/browser/tests/frame_test.go b/internal/js/modules/k6/browser/tests/frame_test.go similarity index 98% rename from js/modules/k6/browser/tests/frame_test.go rename to internal/js/modules/k6/browser/tests/frame_test.go index d5ffa06e5c5..9629b7190bc 100644 --- a/js/modules/k6/browser/tests/frame_test.go +++ b/internal/js/modules/k6/browser/tests/frame_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/env" ) func TestFramePress(t *testing.T) { diff --git a/js/modules/k6/browser/tests/helpers.go b/internal/js/modules/k6/browser/tests/helpers.go similarity index 91% rename from js/modules/k6/browser/tests/helpers.go rename to internal/js/modules/k6/browser/tests/helpers.go index 5e73a2451d7..c5c53bacf4b 100644 --- a/js/modules/k6/browser/tests/helpers.go +++ b/internal/js/modules/k6/browser/tests/helpers.go @@ -6,8 +6,8 @@ import ( "github.com/grafana/sobek" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/browser" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/browser" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" ) // startIteration will work with the event system to start chrome and diff --git a/js/modules/k6/browser/tests/js_handle_get_properties_test.go b/internal/js/modules/k6/browser/tests/js_handle_get_properties_test.go similarity index 100% rename from js/modules/k6/browser/tests/js_handle_get_properties_test.go rename to internal/js/modules/k6/browser/tests/js_handle_get_properties_test.go diff --git a/js/modules/k6/browser/tests/js_handle_test.go b/internal/js/modules/k6/browser/tests/js_handle_test.go similarity index 100% rename from js/modules/k6/browser/tests/js_handle_test.go rename to internal/js/modules/k6/browser/tests/js_handle_test.go diff --git a/js/modules/k6/browser/tests/keyboard_test.go b/internal/js/modules/k6/browser/tests/keyboard_test.go similarity index 98% rename from js/modules/k6/browser/tests/keyboard_test.go rename to internal/js/modules/k6/browser/tests/keyboard_test.go index 89c15f7e048..223e87d0734 100644 --- a/js/modules/k6/browser/tests/keyboard_test.go +++ b/internal/js/modules/k6/browser/tests/keyboard_test.go @@ -13,8 +13,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/keyboardlayout" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/keyboardlayout" ) func TestKeyboardPress(t *testing.T) { diff --git a/js/modules/k6/browser/tests/launch_options_slowmo_test.go b/internal/js/modules/k6/browser/tests/launch_options_slowmo_test.go similarity index 99% rename from js/modules/k6/browser/tests/launch_options_slowmo_test.go rename to internal/js/modules/k6/browser/tests/launch_options_slowmo_test.go index 190763b6c4c..8a6a07efcc7 100644 --- a/js/modules/k6/browser/tests/launch_options_slowmo_test.go +++ b/internal/js/modules/k6/browser/tests/launch_options_slowmo_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) func TestBrowserOptionsSlowMo(t *testing.T) { diff --git a/js/modules/k6/browser/tests/lifecycle_wait_test.go b/internal/js/modules/k6/browser/tests/lifecycle_wait_test.go similarity index 99% rename from js/modules/k6/browser/tests/lifecycle_wait_test.go rename to internal/js/modules/k6/browser/tests/lifecycle_wait_test.go index fee3a53b9fa..206d76f3b64 100644 --- a/js/modules/k6/browser/tests/lifecycle_wait_test.go +++ b/internal/js/modules/k6/browser/tests/lifecycle_wait_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) // TODO diff --git a/js/modules/k6/browser/tests/locator_test.go b/internal/js/modules/k6/browser/tests/locator_test.go similarity index 99% rename from js/modules/k6/browser/tests/locator_test.go rename to internal/js/modules/k6/browser/tests/locator_test.go index 16e6bccc001..9f4135fadcc 100644 --- a/js/modules/k6/browser/tests/locator_test.go +++ b/internal/js/modules/k6/browser/tests/locator_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) // Strict mode: diff --git a/js/modules/k6/browser/tests/logrus_hook.go b/internal/js/modules/k6/browser/tests/logrus_hook.go similarity index 100% rename from js/modules/k6/browser/tests/logrus_hook.go rename to internal/js/modules/k6/browser/tests/logrus_hook.go diff --git a/js/modules/k6/browser/tests/mouse_test.go b/internal/js/modules/k6/browser/tests/mouse_test.go similarity index 100% rename from js/modules/k6/browser/tests/mouse_test.go rename to internal/js/modules/k6/browser/tests/mouse_test.go diff --git a/js/modules/k6/browser/tests/network_manager_test.go b/internal/js/modules/k6/browser/tests/network_manager_test.go similarity index 99% rename from js/modules/k6/browser/tests/network_manager_test.go rename to internal/js/modules/k6/browser/tests/network_manager_test.go index 44463e9ecbb..a5898f472c9 100644 --- a/js/modules/k6/browser/tests/network_manager_test.go +++ b/internal/js/modules/k6/browser/tests/network_manager_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" k6lib "go.k6.io/k6/lib" k6types "go.k6.io/k6/lib/types" diff --git a/js/modules/k6/browser/tests/page_test.go b/internal/js/modules/k6/browser/tests/page_test.go similarity index 99% rename from js/modules/k6/browser/tests/page_test.go rename to internal/js/modules/k6/browser/tests/page_test.go index a4ac5f9c2c0..93cce1bbec2 100644 --- a/js/modules/k6/browser/tests/page_test.go +++ b/internal/js/modules/k6/browser/tests/page_test.go @@ -19,8 +19,8 @@ import ( "github.com/stretchr/testify/require" k6metrics "go.k6.io/k6/metrics" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" ) type emulateMediaOpts struct { diff --git a/js/modules/k6/browser/tests/remote_obj_test.go b/internal/js/modules/k6/browser/tests/remote_obj_test.go similarity index 98% rename from js/modules/k6/browser/tests/remote_obj_test.go rename to internal/js/modules/k6/browser/tests/remote_obj_test.go index 4f28e7e7790..cf2ef246fc3 100644 --- a/js/modules/k6/browser/tests/remote_obj_test.go +++ b/internal/js/modules/k6/browser/tests/remote_obj_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) func TestConsoleLogParse(t *testing.T) { diff --git a/js/modules/k6/browser/tests/setinputfiles_test.go b/internal/js/modules/k6/browser/tests/setinputfiles_test.go similarity index 99% rename from js/modules/k6/browser/tests/setinputfiles_test.go rename to internal/js/modules/k6/browser/tests/setinputfiles_test.go index 2691cab92c8..21eb5e28658 100644 --- a/js/modules/k6/browser/tests/setinputfiles_test.go +++ b/internal/js/modules/k6/browser/tests/setinputfiles_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" ) // TestSetInputFiles tests the SetInputFiles function. diff --git a/js/modules/k6/browser/tests/static/concealed_link.html b/internal/js/modules/k6/browser/tests/static/concealed_link.html similarity index 100% rename from js/modules/k6/browser/tests/static/concealed_link.html rename to internal/js/modules/k6/browser/tests/static/concealed_link.html diff --git a/js/modules/k6/browser/tests/static/dialog.html b/internal/js/modules/k6/browser/tests/static/dialog.html similarity index 100% rename from js/modules/k6/browser/tests/static/dialog.html rename to internal/js/modules/k6/browser/tests/static/dialog.html diff --git a/js/modules/k6/browser/tests/static/embedded_iframe.html b/internal/js/modules/k6/browser/tests/static/embedded_iframe.html similarity index 100% rename from js/modules/k6/browser/tests/static/embedded_iframe.html rename to internal/js/modules/k6/browser/tests/static/embedded_iframe.html diff --git a/js/modules/k6/browser/tests/static/iframe_home.html b/internal/js/modules/k6/browser/tests/static/iframe_home.html similarity index 100% rename from js/modules/k6/browser/tests/static/iframe_home.html rename to internal/js/modules/k6/browser/tests/static/iframe_home.html diff --git a/js/modules/k6/browser/tests/static/iframe_signin.html b/internal/js/modules/k6/browser/tests/static/iframe_signin.html similarity index 100% rename from js/modules/k6/browser/tests/static/iframe_signin.html rename to internal/js/modules/k6/browser/tests/static/iframe_signin.html diff --git a/js/modules/k6/browser/tests/static/iframe_test_main.html b/internal/js/modules/k6/browser/tests/static/iframe_test_main.html similarity index 100% rename from js/modules/k6/browser/tests/static/iframe_test_main.html rename to internal/js/modules/k6/browser/tests/static/iframe_test_main.html diff --git a/js/modules/k6/browser/tests/static/iframe_test_nested1.html b/internal/js/modules/k6/browser/tests/static/iframe_test_nested1.html similarity index 100% rename from js/modules/k6/browser/tests/static/iframe_test_nested1.html rename to internal/js/modules/k6/browser/tests/static/iframe_test_nested1.html diff --git a/js/modules/k6/browser/tests/static/iframe_test_nested2.html b/internal/js/modules/k6/browser/tests/static/iframe_test_nested2.html similarity index 100% rename from js/modules/k6/browser/tests/static/iframe_test_nested2.html rename to internal/js/modules/k6/browser/tests/static/iframe_test_nested2.html diff --git a/js/modules/k6/browser/tests/static/lifecycle.html b/internal/js/modules/k6/browser/tests/static/lifecycle.html similarity index 100% rename from js/modules/k6/browser/tests/static/lifecycle.html rename to internal/js/modules/k6/browser/tests/static/lifecycle.html diff --git a/js/modules/k6/browser/tests/static/lifecycle_main_frame.html b/internal/js/modules/k6/browser/tests/static/lifecycle_main_frame.html similarity index 100% rename from js/modules/k6/browser/tests/static/lifecycle_main_frame.html rename to internal/js/modules/k6/browser/tests/static/lifecycle_main_frame.html diff --git a/js/modules/k6/browser/tests/static/lifecycle_no_ping_js.html b/internal/js/modules/k6/browser/tests/static/lifecycle_no_ping_js.html similarity index 100% rename from js/modules/k6/browser/tests/static/lifecycle_no_ping_js.html rename to internal/js/modules/k6/browser/tests/static/lifecycle_no_ping_js.html diff --git a/js/modules/k6/browser/tests/static/locators.html b/internal/js/modules/k6/browser/tests/static/locators.html similarity index 100% rename from js/modules/k6/browser/tests/static/locators.html rename to internal/js/modules/k6/browser/tests/static/locators.html diff --git a/js/modules/k6/browser/tests/static/mouse_helper.js b/internal/js/modules/k6/browser/tests/static/mouse_helper.js similarity index 100% rename from js/modules/k6/browser/tests/static/mouse_helper.js rename to internal/js/modules/k6/browser/tests/static/mouse_helper.js diff --git a/js/modules/k6/browser/tests/static/nav_in_doc.html b/internal/js/modules/k6/browser/tests/static/nav_in_doc.html similarity index 100% rename from js/modules/k6/browser/tests/static/nav_in_doc.html rename to internal/js/modules/k6/browser/tests/static/nav_in_doc.html diff --git a/js/modules/k6/browser/tests/static/non_clickable.html b/internal/js/modules/k6/browser/tests/static/non_clickable.html similarity index 100% rename from js/modules/k6/browser/tests/static/non_clickable.html rename to internal/js/modules/k6/browser/tests/static/non_clickable.html diff --git a/js/modules/k6/browser/tests/static/page1.html b/internal/js/modules/k6/browser/tests/static/page1.html similarity index 100% rename from js/modules/k6/browser/tests/static/page1.html rename to internal/js/modules/k6/browser/tests/static/page1.html diff --git a/js/modules/k6/browser/tests/static/page2.html b/internal/js/modules/k6/browser/tests/static/page2.html similarity index 100% rename from js/modules/k6/browser/tests/static/page2.html rename to internal/js/modules/k6/browser/tests/static/page2.html diff --git a/js/modules/k6/browser/tests/static/ping.html b/internal/js/modules/k6/browser/tests/static/ping.html similarity index 100% rename from js/modules/k6/browser/tests/static/ping.html rename to internal/js/modules/k6/browser/tests/static/ping.html diff --git a/js/modules/k6/browser/tests/static/select_options.html b/internal/js/modules/k6/browser/tests/static/select_options.html similarity index 100% rename from js/modules/k6/browser/tests/static/select_options.html rename to internal/js/modules/k6/browser/tests/static/select_options.html diff --git a/js/modules/k6/browser/tests/static/shadow_and_doc_frag.html b/internal/js/modules/k6/browser/tests/static/shadow_and_doc_frag.html similarity index 100% rename from js/modules/k6/browser/tests/static/shadow_and_doc_frag.html rename to internal/js/modules/k6/browser/tests/static/shadow_and_doc_frag.html diff --git a/js/modules/k6/browser/tests/static/shadow_dom_link.html b/internal/js/modules/k6/browser/tests/static/shadow_dom_link.html similarity index 100% rename from js/modules/k6/browser/tests/static/shadow_dom_link.html rename to internal/js/modules/k6/browser/tests/static/shadow_dom_link.html diff --git a/js/modules/k6/browser/tests/static/usual.html b/internal/js/modules/k6/browser/tests/static/usual.html similarity index 100% rename from js/modules/k6/browser/tests/static/usual.html rename to internal/js/modules/k6/browser/tests/static/usual.html diff --git a/js/modules/k6/browser/tests/static/visible.html b/internal/js/modules/k6/browser/tests/static/visible.html similarity index 100% rename from js/modules/k6/browser/tests/static/visible.html rename to internal/js/modules/k6/browser/tests/static/visible.html diff --git a/js/modules/k6/browser/tests/static/wait_for.html b/internal/js/modules/k6/browser/tests/static/wait_for.html similarity index 100% rename from js/modules/k6/browser/tests/static/wait_for.html rename to internal/js/modules/k6/browser/tests/static/wait_for.html diff --git a/js/modules/k6/browser/tests/static/wait_until.html b/internal/js/modules/k6/browser/tests/static/wait_until.html similarity index 100% rename from js/modules/k6/browser/tests/static/wait_until.html rename to internal/js/modules/k6/browser/tests/static/wait_until.html diff --git a/js/modules/k6/browser/tests/static/web_vitals.html b/internal/js/modules/k6/browser/tests/static/web_vitals.html similarity index 100% rename from js/modules/k6/browser/tests/static/web_vitals.html rename to internal/js/modules/k6/browser/tests/static/web_vitals.html diff --git a/js/modules/k6/browser/tests/test_browser.go b/internal/js/modules/k6/browser/tests/test_browser.go similarity index 96% rename from js/modules/k6/browser/tests/test_browser.go rename to internal/js/modules/k6/browser/tests/test_browser.go index d9464cd1b05..5a6cbd27199 100644 --- a/js/modules/k6/browser/tests/test_browser.go +++ b/internal/js/modules/k6/browser/tests/test_browser.go @@ -13,14 +13,14 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/sync/errgroup" - "go.k6.io/k6/js/modules/k6/browser/chromium" - "go.k6.io/k6/js/modules/k6/browser/common" - "go.k6.io/k6/js/modules/k6/browser/env" - "go.k6.io/k6/js/modules/k6/browser/k6ext" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" + "go.k6.io/k6/internal/js/modules/k6/browser/chromium" + "go.k6.io/k6/internal/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" + k6httpmultibin "go.k6.io/k6/internal/lib/testutils/httpmultibin" k6http "go.k6.io/k6/js/modules/k6/http" - k6httpmultibin "go.k6.io/k6/lib/testutils/httpmultibin" k6metrics "go.k6.io/k6/metrics" ) diff --git a/js/modules/k6/browser/tests/test_browser_proxy.go b/internal/js/modules/k6/browser/tests/test_browser_proxy.go similarity index 100% rename from js/modules/k6/browser/tests/test_browser_proxy.go rename to internal/js/modules/k6/browser/tests/test_browser_proxy.go diff --git a/js/modules/k6/browser/tests/test_browser_test.go b/internal/js/modules/k6/browser/tests/test_browser_test.go similarity index 96% rename from js/modules/k6/browser/tests/test_browser_test.go rename to internal/js/modules/k6/browser/tests/test_browser_test.go index 53cfabd749d..4cfe2511c6b 100644 --- a/js/modules/k6/browser/tests/test_browser_test.go +++ b/internal/js/modules/k6/browser/tests/test_browser_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/env" + "go.k6.io/k6/internal/js/modules/k6/browser/env" ) func TestTestBrowserAwaitWithTimeoutShortCircuit(t *testing.T) { diff --git a/js/modules/k6/browser/tests/tracing_test.go b/internal/js/modules/k6/browser/tests/tracing_test.go similarity index 98% rename from js/modules/k6/browser/tests/tracing_test.go rename to internal/js/modules/k6/browser/tests/tracing_test.go index eccbbab6fef..8daaec5a896 100644 --- a/js/modules/k6/browser/tests/tracing_test.go +++ b/internal/js/modules/k6/browser/tests/tracing_test.go @@ -15,9 +15,9 @@ import ( "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/embedded" - "go.k6.io/k6/js/modules/k6/browser/browser" - "go.k6.io/k6/js/modules/k6/browser/k6ext/k6test" - browsertrace "go.k6.io/k6/js/modules/k6/browser/trace" + "go.k6.io/k6/internal/js/modules/k6/browser/browser" + "go.k6.io/k6/internal/js/modules/k6/browser/k6ext/k6test" + browsertrace "go.k6.io/k6/internal/js/modules/k6/browser/trace" k6lib "go.k6.io/k6/lib" ) diff --git a/js/modules/k6/browser/tests/webvital_test.go b/internal/js/modules/k6/browser/tests/webvital_test.go similarity index 98% rename from js/modules/k6/browser/tests/webvital_test.go rename to internal/js/modules/k6/browser/tests/webvital_test.go index 319751642e3..a9abf82fb09 100644 --- a/js/modules/k6/browser/tests/webvital_test.go +++ b/internal/js/modules/k6/browser/tests/webvital_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/browser/common" + "go.k6.io/k6/internal/js/modules/k6/browser/common" k6metrics "go.k6.io/k6/metrics" ) diff --git a/js/modules/k6/browser/tests/ws/server.go b/internal/js/modules/k6/browser/tests/ws/server.go similarity index 100% rename from js/modules/k6/browser/tests/ws/server.go rename to internal/js/modules/k6/browser/tests/ws/server.go diff --git a/js/modules/k6/browser/trace/trace.go b/internal/js/modules/k6/browser/trace/trace.go similarity index 100% rename from js/modules/k6/browser/trace/trace.go rename to internal/js/modules/k6/browser/trace/trace.go diff --git a/js/modules/k6/crypto/crypto.go b/internal/js/modules/k6/crypto/crypto.go similarity index 100% rename from js/modules/k6/crypto/crypto.go rename to internal/js/modules/k6/crypto/crypto.go diff --git a/js/modules/k6/crypto/crypto_test.go b/internal/js/modules/k6/crypto/crypto_test.go similarity index 100% rename from js/modules/k6/crypto/crypto_test.go rename to internal/js/modules/k6/crypto/crypto_test.go diff --git a/js/modules/k6/crypto/x509/x509.go b/internal/js/modules/k6/crypto/x509/x509.go similarity index 100% rename from js/modules/k6/crypto/x509/x509.go rename to internal/js/modules/k6/crypto/x509/x509.go diff --git a/js/modules/k6/crypto/x509/x509_test.go b/internal/js/modules/k6/crypto/x509/x509_test.go similarity index 100% rename from js/modules/k6/crypto/x509/x509_test.go rename to internal/js/modules/k6/crypto/x509/x509_test.go diff --git a/js/modules/k6/data/data.go b/internal/js/modules/k6/data/data.go similarity index 100% rename from js/modules/k6/data/data.go rename to internal/js/modules/k6/data/data.go diff --git a/js/modules/k6/data/share.go b/internal/js/modules/k6/data/share.go similarity index 100% rename from js/modules/k6/data/share.go rename to internal/js/modules/k6/data/share.go diff --git a/js/modules/k6/data/share_test.go b/internal/js/modules/k6/data/share_test.go similarity index 99% rename from js/modules/k6/data/share_test.go rename to internal/js/modules/k6/data/share_test.go index d25559a7679..c05ebc6fa69 100644 --- a/js/modules/k6/data/share_test.go +++ b/internal/js/modules/k6/data/share_test.go @@ -10,8 +10,8 @@ import ( "github.com/grafana/sobek" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/js/compiler" "go.k6.io/k6/js/common" - "go.k6.io/k6/js/compiler" "go.k6.io/k6/js/modulestest" ) diff --git a/js/modules/k6/encoding/encoding.go b/internal/js/modules/k6/encoding/encoding.go similarity index 100% rename from js/modules/k6/encoding/encoding.go rename to internal/js/modules/k6/encoding/encoding.go diff --git a/js/modules/k6/encoding/encoding_test.go b/internal/js/modules/k6/encoding/encoding_test.go similarity index 100% rename from js/modules/k6/encoding/encoding_test.go rename to internal/js/modules/k6/encoding/encoding_test.go diff --git a/js/modules/k6/execution/execution.go b/internal/js/modules/k6/execution/execution.go similarity index 100% rename from js/modules/k6/execution/execution.go rename to internal/js/modules/k6/execution/execution.go diff --git a/js/modules/k6/execution/execution_test.go b/internal/js/modules/k6/execution/execution_test.go similarity index 99% rename from js/modules/k6/execution/execution_test.go rename to internal/js/modules/k6/execution/execution_test.go index 114047de3f9..82e248d8b1a 100644 --- a/js/modules/k6/execution/execution_test.go +++ b/internal/js/modules/k6/execution/execution_test.go @@ -15,11 +15,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.k6.io/k6/errext" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/js/common" "go.k6.io/k6/js/modulestest" "go.k6.io/k6/lib" "go.k6.io/k6/lib/executor" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" "gopkg.in/guregu/null.v3" diff --git a/js/modules/k6/experimental/README.md b/internal/js/modules/k6/experimental/README.md similarity index 100% rename from js/modules/k6/experimental/README.md rename to internal/js/modules/k6/experimental/README.md diff --git a/js/modules/k6/experimental/csv/module.go b/internal/js/modules/k6/experimental/csv/module.go similarity index 98% rename from js/modules/k6/experimental/csv/module.go rename to internal/js/modules/k6/experimental/csv/module.go index 722dccbdb0b..a3bfbda80d9 100644 --- a/js/modules/k6/experimental/csv/module.go +++ b/internal/js/modules/k6/experimental/csv/module.go @@ -9,7 +9,7 @@ import ( "sync/atomic" "time" - "go.k6.io/k6/js/modules/k6/data" + "go.k6.io/k6/internal/js/modules/k6/data" "github.com/grafana/sobek" @@ -17,7 +17,7 @@ import ( "go.k6.io/k6/js/promises" - "go.k6.io/k6/js/modules/k6/experimental/fs" + "go.k6.io/k6/internal/js/modules/k6/experimental/fs" "go.k6.io/k6/js/common" "go.k6.io/k6/js/modules" diff --git a/js/modules/k6/experimental/csv/module_test.go b/internal/js/modules/k6/experimental/csv/module_test.go similarity index 99% rename from js/modules/k6/experimental/csv/module_test.go rename to internal/js/modules/k6/experimental/csv/module_test.go index d121610e4b5..3f1d8951d86 100644 --- a/js/modules/k6/experimental/csv/module_test.go +++ b/internal/js/modules/k6/experimental/csv/module_test.go @@ -10,10 +10,10 @@ import ( "go.k6.io/k6/lib" - "go.k6.io/k6/js/modules/k6/experimental/fs" + "go.k6.io/k6/internal/js/modules/k6/experimental/fs" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/js/compiler" + "go.k6.io/k6/internal/js/compiler" "github.com/stretchr/testify/require" diff --git a/js/modules/k6/experimental/csv/reader.go b/internal/js/modules/k6/experimental/csv/reader.go similarity index 100% rename from js/modules/k6/experimental/csv/reader.go rename to internal/js/modules/k6/experimental/csv/reader.go diff --git a/js/modules/k6/experimental/csv/reader_test.go b/internal/js/modules/k6/experimental/csv/reader_test.go similarity index 100% rename from js/modules/k6/experimental/csv/reader_test.go rename to internal/js/modules/k6/experimental/csv/reader_test.go diff --git a/js/modules/k6/experimental/experimental.go b/internal/js/modules/k6/experimental/experimental.go similarity index 100% rename from js/modules/k6/experimental/experimental.go rename to internal/js/modules/k6/experimental/experimental.go diff --git a/js/modules/k6/experimental/fs/cache.go b/internal/js/modules/k6/experimental/fs/cache.go similarity index 100% rename from js/modules/k6/experimental/fs/cache.go rename to internal/js/modules/k6/experimental/fs/cache.go diff --git a/js/modules/k6/experimental/fs/cache_test.go b/internal/js/modules/k6/experimental/fs/cache_test.go similarity index 100% rename from js/modules/k6/experimental/fs/cache_test.go rename to internal/js/modules/k6/experimental/fs/cache_test.go diff --git a/js/modules/k6/experimental/fs/errors.go b/internal/js/modules/k6/experimental/fs/errors.go similarity index 100% rename from js/modules/k6/experimental/fs/errors.go rename to internal/js/modules/k6/experimental/fs/errors.go diff --git a/js/modules/k6/experimental/fs/errors_gen.go b/internal/js/modules/k6/experimental/fs/errors_gen.go similarity index 100% rename from js/modules/k6/experimental/fs/errors_gen.go rename to internal/js/modules/k6/experimental/fs/errors_gen.go diff --git a/js/modules/k6/experimental/fs/file.go b/internal/js/modules/k6/experimental/fs/file.go similarity index 100% rename from js/modules/k6/experimental/fs/file.go rename to internal/js/modules/k6/experimental/fs/file.go diff --git a/js/modules/k6/experimental/fs/file_test.go b/internal/js/modules/k6/experimental/fs/file_test.go similarity index 100% rename from js/modules/k6/experimental/fs/file_test.go rename to internal/js/modules/k6/experimental/fs/file_test.go diff --git a/js/modules/k6/experimental/fs/module.go b/internal/js/modules/k6/experimental/fs/module.go similarity index 100% rename from js/modules/k6/experimental/fs/module.go rename to internal/js/modules/k6/experimental/fs/module.go diff --git a/js/modules/k6/experimental/fs/module_test.go b/internal/js/modules/k6/experimental/fs/module_test.go similarity index 99% rename from js/modules/k6/experimental/fs/module_test.go rename to internal/js/modules/k6/experimental/fs/module_test.go index 397e3512640..fddd59c649f 100644 --- a/js/modules/k6/experimental/fs/module_test.go +++ b/internal/js/modules/k6/experimental/fs/module_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/compiler" + "go.k6.io/k6/internal/js/compiler" "go.k6.io/k6/js/modulestest" "go.k6.io/k6/lib" "go.k6.io/k6/lib/fsext" diff --git a/js/modules/k6/experimental/streams/errors.go b/internal/js/modules/k6/experimental/streams/errors.go similarity index 100% rename from js/modules/k6/experimental/streams/errors.go rename to internal/js/modules/k6/experimental/streams/errors.go diff --git a/js/modules/k6/experimental/streams/errors_gen.go b/internal/js/modules/k6/experimental/streams/errors_gen.go similarity index 100% rename from js/modules/k6/experimental/streams/errors_gen.go rename to internal/js/modules/k6/experimental/streams/errors_gen.go diff --git a/js/modules/k6/experimental/streams/goja.go b/internal/js/modules/k6/experimental/streams/goja.go similarity index 100% rename from js/modules/k6/experimental/streams/goja.go rename to internal/js/modules/k6/experimental/streams/goja.go diff --git a/js/modules/k6/experimental/streams/module.go b/internal/js/modules/k6/experimental/streams/module.go similarity index 100% rename from js/modules/k6/experimental/streams/module.go rename to internal/js/modules/k6/experimental/streams/module.go diff --git a/js/modules/k6/experimental/streams/module_test.go b/internal/js/modules/k6/experimental/streams/module_test.go similarity index 100% rename from js/modules/k6/experimental/streams/module_test.go rename to internal/js/modules/k6/experimental/streams/module_test.go diff --git a/js/modules/k6/experimental/streams/queue.go b/internal/js/modules/k6/experimental/streams/queue.go similarity index 100% rename from js/modules/k6/experimental/streams/queue.go rename to internal/js/modules/k6/experimental/streams/queue.go diff --git a/js/modules/k6/experimental/streams/readable_stream_controller.go b/internal/js/modules/k6/experimental/streams/readable_stream_controller.go similarity index 100% rename from js/modules/k6/experimental/streams/readable_stream_controller.go rename to internal/js/modules/k6/experimental/streams/readable_stream_controller.go diff --git a/js/modules/k6/experimental/streams/readable_stream_default_controller.go b/internal/js/modules/k6/experimental/streams/readable_stream_default_controller.go similarity index 100% rename from js/modules/k6/experimental/streams/readable_stream_default_controller.go rename to internal/js/modules/k6/experimental/streams/readable_stream_default_controller.go diff --git a/js/modules/k6/experimental/streams/readable_stream_default_reader.go b/internal/js/modules/k6/experimental/streams/readable_stream_default_reader.go similarity index 100% rename from js/modules/k6/experimental/streams/readable_stream_default_reader.go rename to internal/js/modules/k6/experimental/streams/readable_stream_default_reader.go diff --git a/js/modules/k6/experimental/streams/readable_stream_reader.go b/internal/js/modules/k6/experimental/streams/readable_stream_reader.go similarity index 100% rename from js/modules/k6/experimental/streams/readable_stream_reader.go rename to internal/js/modules/k6/experimental/streams/readable_stream_reader.go diff --git a/js/modules/k6/experimental/streams/readable_streams.go b/internal/js/modules/k6/experimental/streams/readable_streams.go similarity index 100% rename from js/modules/k6/experimental/streams/readable_streams.go rename to internal/js/modules/k6/experimental/streams/readable_streams.go diff --git a/js/modules/k6/experimental/streams/readable_streams_test.go b/internal/js/modules/k6/experimental/streams/readable_streams_test.go similarity index 100% rename from js/modules/k6/experimental/streams/readable_streams_test.go rename to internal/js/modules/k6/experimental/streams/readable_streams_test.go diff --git a/js/modules/k6/experimental/streams/tests/README.md b/internal/js/modules/k6/experimental/streams/tests/README.md similarity index 100% rename from js/modules/k6/experimental/streams/tests/README.md rename to internal/js/modules/k6/experimental/streams/tests/README.md diff --git a/js/modules/k6/experimental/streams/tests/checkout.sh b/internal/js/modules/k6/experimental/streams/tests/checkout.sh similarity index 100% rename from js/modules/k6/experimental/streams/tests/checkout.sh rename to internal/js/modules/k6/experimental/streams/tests/checkout.sh diff --git a/js/modules/k6/experimental/streams/tests/reentrant-strategies.any.js.patch b/internal/js/modules/k6/experimental/streams/tests/reentrant-strategies.any.js.patch similarity index 100% rename from js/modules/k6/experimental/streams/tests/reentrant-strategies.any.js.patch rename to internal/js/modules/k6/experimental/streams/tests/reentrant-strategies.any.js.patch diff --git a/js/modules/k6/experimental/streams/tests/rs-test-templates.js.patch b/internal/js/modules/k6/experimental/streams/tests/rs-test-templates.js.patch similarity index 100% rename from js/modules/k6/experimental/streams/tests/rs-test-templates.js.patch rename to internal/js/modules/k6/experimental/streams/tests/rs-test-templates.js.patch diff --git a/js/modules/k6/experimental/streams/tests/testharness.js.patch b/internal/js/modules/k6/experimental/streams/tests/testharness.js.patch similarity index 100% rename from js/modules/k6/experimental/streams/tests/testharness.js.patch rename to internal/js/modules/k6/experimental/streams/tests/testharness.js.patch diff --git a/js/modules/k6/experimental/streams/underlying_source.go b/internal/js/modules/k6/experimental/streams/underlying_source.go similarity index 100% rename from js/modules/k6/experimental/streams/underlying_source.go rename to internal/js/modules/k6/experimental/streams/underlying_source.go diff --git a/js/modules/k6/experimental/websockets/autobahn_tests/README.md b/internal/js/modules/k6/experimental/websockets/autobahn_tests/README.md similarity index 100% rename from js/modules/k6/experimental/websockets/autobahn_tests/README.md rename to internal/js/modules/k6/experimental/websockets/autobahn_tests/README.md diff --git a/js/modules/k6/experimental/websockets/autobahn_tests/config/fuzzingserver.json b/internal/js/modules/k6/experimental/websockets/autobahn_tests/config/fuzzingserver.json similarity index 100% rename from js/modules/k6/experimental/websockets/autobahn_tests/config/fuzzingserver.json rename to internal/js/modules/k6/experimental/websockets/autobahn_tests/config/fuzzingserver.json diff --git a/js/modules/k6/experimental/websockets/autobahn_tests/reports/.gitkeep b/internal/js/modules/k6/experimental/websockets/autobahn_tests/reports/.gitkeep similarity index 100% rename from js/modules/k6/experimental/websockets/autobahn_tests/reports/.gitkeep rename to internal/js/modules/k6/experimental/websockets/autobahn_tests/reports/.gitkeep diff --git a/js/modules/k6/experimental/websockets/autobahn_tests/script.js b/internal/js/modules/k6/experimental/websockets/autobahn_tests/script.js similarity index 100% rename from js/modules/k6/experimental/websockets/autobahn_tests/script.js rename to internal/js/modules/k6/experimental/websockets/autobahn_tests/script.js diff --git a/js/modules/k6/experimental/websockets/blob.go b/internal/js/modules/k6/experimental/websockets/blob.go similarity index 98% rename from js/modules/k6/experimental/websockets/blob.go rename to internal/js/modules/k6/experimental/websockets/blob.go index ad34d92df51..b9a2fc2f76c 100644 --- a/js/modules/k6/experimental/websockets/blob.go +++ b/internal/js/modules/k6/experimental/websockets/blob.go @@ -9,8 +9,8 @@ import ( "github.com/grafana/sobek" + "go.k6.io/k6/internal/js/modules/k6/experimental/streams" "go.k6.io/k6/js/common" - "go.k6.io/k6/js/modules/k6/experimental/streams" ) type blob struct { diff --git a/js/modules/k6/experimental/websockets/blob_test.go b/internal/js/modules/k6/experimental/websockets/blob_test.go similarity index 100% rename from js/modules/k6/experimental/websockets/blob_test.go rename to internal/js/modules/k6/experimental/websockets/blob_test.go diff --git a/js/modules/k6/experimental/websockets/events/events.go b/internal/js/modules/k6/experimental/websockets/events/events.go similarity index 100% rename from js/modules/k6/experimental/websockets/events/events.go rename to internal/js/modules/k6/experimental/websockets/events/events.go diff --git a/js/modules/k6/experimental/websockets/helpers.go b/internal/js/modules/k6/experimental/websockets/helpers.go similarity index 100% rename from js/modules/k6/experimental/websockets/helpers.go rename to internal/js/modules/k6/experimental/websockets/helpers.go diff --git a/js/modules/k6/experimental/websockets/listeners.go b/internal/js/modules/k6/experimental/websockets/listeners.go similarity index 97% rename from js/modules/k6/experimental/websockets/listeners.go rename to internal/js/modules/k6/experimental/websockets/listeners.go index 79e85a76d55..42b24a1510f 100644 --- a/js/modules/k6/experimental/websockets/listeners.go +++ b/internal/js/modules/k6/experimental/websockets/listeners.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/grafana/sobek" - "go.k6.io/k6/js/modules/k6/experimental/websockets/events" + "go.k6.io/k6/internal/js/modules/k6/experimental/websockets/events" ) // eventListeners keeps track of the eventListeners for each event type diff --git a/js/modules/k6/experimental/websockets/main_test.go b/internal/js/modules/k6/experimental/websockets/main_test.go similarity index 100% rename from js/modules/k6/experimental/websockets/main_test.go rename to internal/js/modules/k6/experimental/websockets/main_test.go diff --git a/js/modules/k6/experimental/websockets/params.go b/internal/js/modules/k6/experimental/websockets/params.go similarity index 100% rename from js/modules/k6/experimental/websockets/params.go rename to internal/js/modules/k6/experimental/websockets/params.go diff --git a/js/modules/k6/experimental/websockets/websockets.go b/internal/js/modules/k6/experimental/websockets/websockets.go similarity index 99% rename from js/modules/k6/experimental/websockets/websockets.go rename to internal/js/modules/k6/experimental/websockets/websockets.go index e682cbbc4ce..31aebeb1972 100644 --- a/js/modules/k6/experimental/websockets/websockets.go +++ b/internal/js/modules/k6/experimental/websockets/websockets.go @@ -16,7 +16,7 @@ import ( "github.com/gorilla/websocket" "github.com/grafana/sobek" "github.com/mstoykov/k6-taskqueue-lib/taskqueue" - "go.k6.io/k6/js/modules/k6/experimental/websockets/events" + "go.k6.io/k6/internal/js/modules/k6/experimental/websockets/events" "go.k6.io/k6/js/common" "go.k6.io/k6/js/modules" diff --git a/js/modules/k6/experimental/websockets/websockets_test.go b/internal/js/modules/k6/experimental/websockets/websockets_test.go similarity index 99% rename from js/modules/k6/experimental/websockets/websockets_test.go rename to internal/js/modules/k6/experimental/websockets/websockets_test.go index bac0e8dc28a..2326835ea90 100644 --- a/js/modules/k6/experimental/websockets/websockets_test.go +++ b/internal/js/modules/k6/experimental/websockets/websockets_test.go @@ -16,11 +16,11 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" httpModule "go.k6.io/k6/js/modules/k6/http" "go.k6.io/k6/js/modulestest" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" "go.k6.io/k6/metrics" ) diff --git a/js/modules/k6/grpc/client.go b/internal/js/modules/k6/grpc/client.go similarity index 99% rename from js/modules/k6/grpc/client.go rename to internal/js/modules/k6/grpc/client.go index f58ae394e78..20b507829ff 100644 --- a/js/modules/k6/grpc/client.go +++ b/internal/js/modules/k6/grpc/client.go @@ -11,9 +11,9 @@ import ( "strings" "time" + "go.k6.io/k6/internal/lib/netext/grpcext" "go.k6.io/k6/js/common" "go.k6.io/k6/js/modules" - "go.k6.io/k6/lib/netext/grpcext" "github.com/grafana/sobek" "github.com/jhump/protoreflect/desc" //nolint:staticcheck // FIXME: #4035 diff --git a/js/modules/k6/grpc/client_test.go b/internal/js/modules/k6/grpc/client_test.go similarity index 99% rename from js/modules/k6/grpc/client_test.go rename to internal/js/modules/k6/grpc/client_test.go index 26effd7a2fd..e9dd8c864dc 100644 --- a/js/modules/k6/grpc/client_test.go +++ b/internal/js/modules/k6/grpc/client_test.go @@ -10,12 +10,12 @@ import ( "strings" "testing" - k6grpc "go.k6.io/k6/js/modules/k6/grpc" - "go.k6.io/k6/lib/netext/grpcext" - "go.k6.io/k6/lib/testutils/httpmultibin" - grpcanytesting "go.k6.io/k6/lib/testutils/httpmultibin/grpc_any_testing" - "go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing" - "go.k6.io/k6/lib/testutils/httpmultibin/grpc_wrappers_testing" + k6grpc "go.k6.io/k6/internal/js/modules/k6/grpc" + "go.k6.io/k6/internal/lib/netext/grpcext" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" + grpcanytesting "go.k6.io/k6/internal/lib/testutils/httpmultibin/grpc_any_testing" + "go.k6.io/k6/internal/lib/testutils/httpmultibin/grpc_testing" + "go.k6.io/k6/internal/lib/testutils/httpmultibin/grpc_wrappers_testing" "go.k6.io/k6/metrics" "google.golang.org/grpc" diff --git a/js/modules/k6/grpc/grpc.go b/internal/js/modules/k6/grpc/grpc.go similarity index 100% rename from js/modules/k6/grpc/grpc.go rename to internal/js/modules/k6/grpc/grpc.go diff --git a/js/modules/k6/grpc/helpers_test.go b/internal/js/modules/k6/grpc/helpers_test.go similarity index 100% rename from js/modules/k6/grpc/helpers_test.go rename to internal/js/modules/k6/grpc/helpers_test.go diff --git a/js/modules/k6/grpc/listeners.go b/internal/js/modules/k6/grpc/listeners.go similarity index 100% rename from js/modules/k6/grpc/listeners.go rename to internal/js/modules/k6/grpc/listeners.go diff --git a/js/modules/k6/grpc/metrics.go b/internal/js/modules/k6/grpc/metrics.go similarity index 100% rename from js/modules/k6/grpc/metrics.go rename to internal/js/modules/k6/grpc/metrics.go diff --git a/js/modules/k6/grpc/params.go b/internal/js/modules/k6/grpc/params.go similarity index 100% rename from js/modules/k6/grpc/params.go rename to internal/js/modules/k6/grpc/params.go diff --git a/js/modules/k6/grpc/params_test.go b/internal/js/modules/k6/grpc/params_test.go similarity index 100% rename from js/modules/k6/grpc/params_test.go rename to internal/js/modules/k6/grpc/params_test.go diff --git a/js/modules/k6/grpc/stream.go b/internal/js/modules/k6/grpc/stream.go similarity index 99% rename from js/modules/k6/grpc/stream.go rename to internal/js/modules/k6/grpc/stream.go index 029588b5df9..12f0217d0fb 100644 --- a/js/modules/k6/grpc/stream.go +++ b/internal/js/modules/k6/grpc/stream.go @@ -9,9 +9,9 @@ import ( "sync" "time" + "go.k6.io/k6/internal/lib/netext/grpcext" "go.k6.io/k6/js/common" "go.k6.io/k6/js/modules" - "go.k6.io/k6/lib/netext/grpcext" "go.k6.io/k6/metrics" "github.com/grafana/sobek" diff --git a/js/modules/k6/grpc/stream_test.go b/internal/js/modules/k6/grpc/stream_test.go similarity index 99% rename from js/modules/k6/grpc/stream_test.go rename to internal/js/modules/k6/grpc/stream_test.go index 715aa850ab4..825c722d36d 100644 --- a/js/modules/k6/grpc/stream_test.go +++ b/internal/js/modules/k6/grpc/stream_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "go.k6.io/k6/lib/testutils/grpcservice" - "go.k6.io/k6/lib/testutils/httpmultibin/grpc_wrappers_testing" + "go.k6.io/k6/internal/lib/testutils/grpcservice" + "go.k6.io/k6/internal/lib/testutils/httpmultibin/grpc_wrappers_testing" "go.k6.io/k6/metrics" "github.com/golang/protobuf/ptypes/wrappers" diff --git a/js/modules/k6/grpc/teststate_test.go b/internal/js/modules/k6/grpc/teststate_test.go similarity index 96% rename from js/modules/k6/grpc/teststate_test.go rename to internal/js/modules/k6/grpc/teststate_test.go index e14de530926..830eef515a4 100644 --- a/js/modules/k6/grpc/teststate_test.go +++ b/internal/js/modules/k6/grpc/teststate_test.go @@ -11,15 +11,15 @@ import ( "github.com/grafana/sobek" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" "go.k6.io/k6/js/modulestest" "go.k6.io/k6/lib" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" "go.k6.io/k6/metrics" "gopkg.in/guregu/null.v3" - xk6grpc "go.k6.io/k6/js/modules/k6/grpc" + xk6grpc "go.k6.io/k6/internal/js/modules/k6/grpc" ) const isWindows = runtime.GOOS == "windows" diff --git a/js/modules/k6/html/gen/gen_elements.go b/internal/js/modules/k6/html/gen/gen_elements.go similarity index 100% rename from js/modules/k6/html/gen/gen_elements.go rename to internal/js/modules/k6/html/gen/gen_elements.go diff --git a/js/modules/k6/metrics/metrics.go b/internal/js/modules/k6/metrics/metrics.go similarity index 100% rename from js/modules/k6/metrics/metrics.go rename to internal/js/modules/k6/metrics/metrics.go diff --git a/js/modules/k6/metrics/metrics_test.go b/internal/js/modules/k6/metrics/metrics_test.go similarity index 99% rename from js/modules/k6/metrics/metrics_test.go rename to internal/js/modules/k6/metrics/metrics_test.go index 4ec6b2cef20..a47efab47a9 100644 --- a/js/modules/k6/metrics/metrics_test.go +++ b/internal/js/modules/k6/metrics/metrics_test.go @@ -11,10 +11,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/js/common" "go.k6.io/k6/js/modulestest" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/metrics" ) diff --git a/js/modules/k6/timers/timers.go b/internal/js/modules/k6/timers/timers.go similarity index 100% rename from js/modules/k6/timers/timers.go rename to internal/js/modules/k6/timers/timers.go diff --git a/js/modules/k6/timers/timers_test.go b/internal/js/modules/k6/timers/timers_test.go similarity index 99% rename from js/modules/k6/timers/timers_test.go rename to internal/js/modules/k6/timers/timers_test.go index 3cd1ad1c334..98c3b11483a 100644 --- a/js/modules/k6/timers/timers_test.go +++ b/internal/js/modules/k6/timers/timers_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/stretchr/testify/require" - "go.k6.io/k6/js/modules/k6/timers" + "go.k6.io/k6/internal/js/modules/k6/timers" "go.k6.io/k6/js/modulestest" ) diff --git a/js/modules/k6/webcrypto/aes.go b/internal/js/modules/k6/webcrypto/aes.go similarity index 100% rename from js/modules/k6/webcrypto/aes.go rename to internal/js/modules/k6/webcrypto/aes.go diff --git a/js/modules/k6/webcrypto/algorithm.go b/internal/js/modules/k6/webcrypto/algorithm.go similarity index 100% rename from js/modules/k6/webcrypto/algorithm.go rename to internal/js/modules/k6/webcrypto/algorithm.go diff --git a/js/modules/k6/webcrypto/base64.go b/internal/js/modules/k6/webcrypto/base64.go similarity index 100% rename from js/modules/k6/webcrypto/base64.go rename to internal/js/modules/k6/webcrypto/base64.go diff --git a/js/modules/k6/webcrypto/bits.go b/internal/js/modules/k6/webcrypto/bits.go similarity index 100% rename from js/modules/k6/webcrypto/bits.go rename to internal/js/modules/k6/webcrypto/bits.go diff --git a/js/modules/k6/webcrypto/cmd_run_test.go b/internal/js/modules/k6/webcrypto/cmd_run_test.go similarity index 96% rename from js/modules/k6/webcrypto/cmd_run_test.go rename to internal/js/modules/k6/webcrypto/cmd_run_test.go index 76e1a2f15de..3ee0692fd2f 100644 --- a/js/modules/k6/webcrypto/cmd_run_test.go +++ b/internal/js/modules/k6/webcrypto/cmd_run_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/cmd" - k6Tests "go.k6.io/k6/cmd/tests" "go.k6.io/k6/errext/exitcodes" + "go.k6.io/k6/internal/cmd" + k6Tests "go.k6.io/k6/internal/cmd/tests" "go.k6.io/k6/lib/fsext" ) @@ -51,7 +51,7 @@ func TestExamplesInputOutput(t *testing.T) { "level=error", // no error messages } - const examplesDir = "../../../../examples/webcrypto" + const examplesDir = "../../../../../examples/webcrypto" // List of the directories containing the examples // that we should run and check that they produce the expected output diff --git a/js/modules/k6/webcrypto/crypto.go b/internal/js/modules/k6/webcrypto/crypto.go similarity index 100% rename from js/modules/k6/webcrypto/crypto.go rename to internal/js/modules/k6/webcrypto/crypto.go diff --git a/js/modules/k6/webcrypto/elliptic_curve.go b/internal/js/modules/k6/webcrypto/elliptic_curve.go similarity index 100% rename from js/modules/k6/webcrypto/elliptic_curve.go rename to internal/js/modules/k6/webcrypto/elliptic_curve.go diff --git a/js/modules/k6/webcrypto/encryption.go b/internal/js/modules/k6/webcrypto/encryption.go similarity index 100% rename from js/modules/k6/webcrypto/encryption.go rename to internal/js/modules/k6/webcrypto/encryption.go diff --git a/js/modules/k6/webcrypto/errors.go b/internal/js/modules/k6/webcrypto/errors.go similarity index 100% rename from js/modules/k6/webcrypto/errors.go rename to internal/js/modules/k6/webcrypto/errors.go diff --git a/js/modules/k6/webcrypto/hash.go b/internal/js/modules/k6/webcrypto/hash.go similarity index 100% rename from js/modules/k6/webcrypto/hash.go rename to internal/js/modules/k6/webcrypto/hash.go diff --git a/js/modules/k6/webcrypto/hmac.go b/internal/js/modules/k6/webcrypto/hmac.go similarity index 100% rename from js/modules/k6/webcrypto/hmac.go rename to internal/js/modules/k6/webcrypto/hmac.go diff --git a/js/modules/k6/webcrypto/jwk.go b/internal/js/modules/k6/webcrypto/jwk.go similarity index 100% rename from js/modules/k6/webcrypto/jwk.go rename to internal/js/modules/k6/webcrypto/jwk.go diff --git a/js/modules/k6/webcrypto/key.go b/internal/js/modules/k6/webcrypto/key.go similarity index 100% rename from js/modules/k6/webcrypto/key.go rename to internal/js/modules/k6/webcrypto/key.go diff --git a/js/modules/k6/webcrypto/module.go b/internal/js/modules/k6/webcrypto/module.go similarity index 100% rename from js/modules/k6/webcrypto/module.go rename to internal/js/modules/k6/webcrypto/module.go diff --git a/js/modules/k6/webcrypto/params.go b/internal/js/modules/k6/webcrypto/params.go similarity index 100% rename from js/modules/k6/webcrypto/params.go rename to internal/js/modules/k6/webcrypto/params.go diff --git a/js/modules/k6/webcrypto/rsa.go b/internal/js/modules/k6/webcrypto/rsa.go similarity index 100% rename from js/modules/k6/webcrypto/rsa.go rename to internal/js/modules/k6/webcrypto/rsa.go diff --git a/js/modules/k6/webcrypto/signer.go b/internal/js/modules/k6/webcrypto/signer.go similarity index 100% rename from js/modules/k6/webcrypto/signer.go rename to internal/js/modules/k6/webcrypto/signer.go diff --git a/js/modules/k6/webcrypto/sobek.go b/internal/js/modules/k6/webcrypto/sobek.go similarity index 100% rename from js/modules/k6/webcrypto/sobek.go rename to internal/js/modules/k6/webcrypto/sobek.go diff --git a/js/modules/k6/webcrypto/sobek_test.go b/internal/js/modules/k6/webcrypto/sobek_test.go similarity index 100% rename from js/modules/k6/webcrypto/sobek_test.go rename to internal/js/modules/k6/webcrypto/sobek_test.go diff --git a/js/modules/k6/webcrypto/subtle_crypto.go b/internal/js/modules/k6/webcrypto/subtle_crypto.go similarity index 100% rename from js/modules/k6/webcrypto/subtle_crypto.go rename to internal/js/modules/k6/webcrypto/subtle_crypto.go diff --git a/js/modules/k6/webcrypto/tests/README.md b/internal/js/modules/k6/webcrypto/tests/README.md similarity index 100% rename from js/modules/k6/webcrypto/tests/README.md rename to internal/js/modules/k6/webcrypto/tests/README.md diff --git a/js/modules/k6/webcrypto/tests/checkout.sh b/internal/js/modules/k6/webcrypto/tests/checkout.sh similarity index 100% rename from js/modules/k6/webcrypto/tests/checkout.sh rename to internal/js/modules/k6/webcrypto/tests/checkout.sh diff --git a/js/modules/k6/webcrypto/tests/crypto_test.go b/internal/js/modules/k6/webcrypto/tests/crypto_test.go similarity index 100% rename from js/modules/k6/webcrypto/tests/crypto_test.go rename to internal/js/modules/k6/webcrypto/tests/crypto_test.go diff --git a/js/modules/k6/webcrypto/tests/generate-patches.sh b/internal/js/modules/k6/webcrypto/tests/generate-patches.sh similarity index 100% rename from js/modules/k6/webcrypto/tests/generate-patches.sh rename to internal/js/modules/k6/webcrypto/tests/generate-patches.sh diff --git a/js/modules/k6/webcrypto/tests/subtle_crypto_test.go b/internal/js/modules/k6/webcrypto/tests/subtle_crypto_test.go similarity index 100% rename from js/modules/k6/webcrypto/tests/subtle_crypto_test.go rename to internal/js/modules/k6/webcrypto/tests/subtle_crypto_test.go diff --git a/js/modules/k6/webcrypto/tests/test_setup_test.go b/internal/js/modules/k6/webcrypto/tests/test_setup_test.go similarity index 93% rename from js/modules/k6/webcrypto/tests/test_setup_test.go rename to internal/js/modules/k6/webcrypto/tests/test_setup_test.go index 42d42b9a982..2abab430dec 100644 --- a/js/modules/k6/webcrypto/tests/test_setup_test.go +++ b/internal/js/modules/k6/webcrypto/tests/test_setup_test.go @@ -5,9 +5,9 @@ package tests import ( "testing" - "go.k6.io/k6/js/compiler" - k6encoding "go.k6.io/k6/js/modules/k6/encoding" - "go.k6.io/k6/js/modules/k6/webcrypto" + "go.k6.io/k6/internal/js/compiler" + k6encoding "go.k6.io/k6/internal/js/modules/k6/encoding" + "go.k6.io/k6/internal/js/modules/k6/webcrypto" "go.k6.io/k6/js/modulestest" "github.com/stretchr/testify/require" diff --git a/js/modules/k6/webcrypto/tests/util/helpers.js b/internal/js/modules/k6/webcrypto/tests/util/helpers.js similarity index 100% rename from js/modules/k6/webcrypto/tests/util/helpers.js rename to internal/js/modules/k6/webcrypto/tests/util/helpers.js diff --git a/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__derive_bits_keys__ecdh_bits.js.patch b/internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__derive_bits_keys__ecdh_bits.js.patch similarity index 100% rename from js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__derive_bits_keys__ecdh_bits.js.patch rename to internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__derive_bits_keys__ecdh_bits.js.patch diff --git a/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__encrypt_decrypt__aes_gcm_vectors.js.patch b/internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__encrypt_decrypt__aes_gcm_vectors.js.patch similarity index 100% rename from js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__encrypt_decrypt__aes_gcm_vectors.js.patch rename to internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__encrypt_decrypt__aes_gcm_vectors.js.patch diff --git a/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__failures.js.patch b/internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__failures.js.patch similarity index 100% rename from js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__failures.js.patch rename to internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__failures.js.patch diff --git a/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__successes.js.patch b/internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__successes.js.patch similarity index 100% rename from js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__successes.js.patch rename to internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__generateKey__successes.js.patch diff --git a/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__ec_importKey.https.any.js.patch b/internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__ec_importKey.https.any.js.patch similarity index 100% rename from js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__ec_importKey.https.any.js.patch rename to internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__ec_importKey.https.any.js.patch diff --git a/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__rsa_importKey.https.any.js.patch b/internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__rsa_importKey.https.any.js.patch similarity index 100% rename from js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__rsa_importKey.https.any.js.patch rename to internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__rsa_importKey.https.any.js.patch diff --git a/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__symmetric_importKey.https.any.js.patch b/internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__symmetric_importKey.https.any.js.patch similarity index 100% rename from js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__symmetric_importKey.https.any.js.patch rename to internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__import_export__symmetric_importKey.https.any.js.patch diff --git a/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__ecdsa_vectors.js.patch b/internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__ecdsa_vectors.js.patch similarity index 100% rename from js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__ecdsa_vectors.js.patch rename to internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__ecdsa_vectors.js.patch diff --git a/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__rsa.js.patch b/internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__rsa.js.patch similarity index 100% rename from js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__rsa.js.patch rename to internal/js/modules/k6/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__rsa.js.patch diff --git a/js/modules/k6/webcrypto/types.go b/internal/js/modules/k6/webcrypto/types.go similarity index 100% rename from js/modules/k6/webcrypto/types.go rename to internal/js/modules/k6/webcrypto/types.go diff --git a/js/modules/k6/ws/ws.go b/internal/js/modules/k6/ws/ws.go similarity index 100% rename from js/modules/k6/ws/ws.go rename to internal/js/modules/k6/ws/ws.go diff --git a/js/modules/k6/ws/ws_test.go b/internal/js/modules/k6/ws/ws_test.go similarity index 99% rename from js/modules/k6/ws/ws_test.go rename to internal/js/modules/k6/ws/ws_test.go index c81425be758..412b1244dd0 100644 --- a/js/modules/k6/ws/ws_test.go +++ b/internal/js/modules/k6/ws/ws_test.go @@ -18,11 +18,11 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" httpModule "go.k6.io/k6/js/modules/k6/http" "go.k6.io/k6/js/modulestest" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" "go.k6.io/k6/metrics" ) diff --git a/js/modules_vu.go b/internal/js/modules_vu.go similarity index 92% rename from js/modules_vu.go rename to internal/js/modules_vu.go index 8db0da82d45..6c35f6f2c7e 100644 --- a/js/modules_vu.go +++ b/internal/js/modules_vu.go @@ -4,9 +4,9 @@ import ( "context" "github.com/grafana/sobek" - "go.k6.io/k6/event" + "go.k6.io/k6/internal/event" + "go.k6.io/k6/internal/js/eventloop" "go.k6.io/k6/js/common" - "go.k6.io/k6/js/eventloop" "go.k6.io/k6/lib" ) diff --git a/js/path_resolution_test.go b/internal/js/path_resolution_test.go similarity index 99% rename from js/path_resolution_test.go rename to internal/js/path_resolution_test.go index 257e35e2c13..f9bd96203ea 100644 --- a/js/path_resolution_test.go +++ b/internal/js/path_resolution_test.go @@ -8,8 +8,8 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" ) // This whole file is about tests around https://github.com/grafana/k6/issues/2674 diff --git a/js/runner.go b/internal/js/runner.go similarity index 99% rename from js/runner.go rename to internal/js/runner.go index c7187cb3e78..c5b28ae9548 100644 --- a/js/runner.go +++ b/internal/js/runner.go @@ -23,15 +23,15 @@ import ( "go.k6.io/k6/errext" "go.k6.io/k6/errext/exitcodes" - "go.k6.io/k6/event" + "go.k6.io/k6/internal/event" + "go.k6.io/k6/internal/js/eventloop" + "go.k6.io/k6/internal/loader" "go.k6.io/k6/js/common" - "go.k6.io/k6/js/eventloop" "go.k6.io/k6/lib" "go.k6.io/k6/lib/consts" "go.k6.io/k6/lib/fsext" "go.k6.io/k6/lib/netext" "go.k6.io/k6/lib/types" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" ) diff --git a/js/runner_test.go b/internal/js/runner_test.go similarity index 99% rename from js/runner_test.go rename to internal/js/runner_test.go index d82bbd57333..898382607d8 100644 --- a/js/runner_test.go +++ b/internal/js/runner_test.go @@ -33,19 +33,19 @@ import ( "gopkg.in/guregu/null.v3" "go.k6.io/k6/errext" - "go.k6.io/k6/execution" - "go.k6.io/k6/execution/local" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/execution/local" + k6metrics "go.k6.io/k6/internal/js/modules/k6/metrics" + "go.k6.io/k6/internal/js/modules/k6/ws" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" + "go.k6.io/k6/internal/lib/testutils/httpmultibin/grpc_testing" + "go.k6.io/k6/internal/lib/testutils/mockoutput" "go.k6.io/k6/js/modules/k6" k6http "go.k6.io/k6/js/modules/k6/http" - k6metrics "go.k6.io/k6/js/modules/k6/metrics" - "go.k6.io/k6/js/modules/k6/ws" "go.k6.io/k6/lib" _ "go.k6.io/k6/lib/executor" // TODO: figure out something better "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" - "go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing" - "go.k6.io/k6/lib/testutils/mockoutput" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" "go.k6.io/k6/output" diff --git a/js/share_test.go b/internal/js/share_test.go similarity index 98% rename from js/share_test.go rename to internal/js/share_test.go index 2ecbb6f5532..8df9316762e 100644 --- a/js/share_test.go +++ b/internal/js/share_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/metrics" ) diff --git a/js/summary-wrapper.js b/internal/js/summary-wrapper.js similarity index 100% rename from js/summary-wrapper.js rename to internal/js/summary-wrapper.js diff --git a/js/summary.go b/internal/js/summary.go similarity index 100% rename from js/summary.go rename to internal/js/summary.go diff --git a/js/summary.js b/internal/js/summary.js similarity index 100% rename from js/summary.js rename to internal/js/summary.js diff --git a/js/summary_test.go b/internal/js/summary_test.go similarity index 99% rename from js/summary_test.go rename to internal/js/summary_test.go index 091028c73cd..2a2da6c508f 100644 --- a/js/summary_test.go +++ b/internal/js/summary_test.go @@ -13,8 +13,8 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/metrics" ) diff --git a/js/tc39/README.md b/internal/js/tc39/README.md similarity index 100% rename from js/tc39/README.md rename to internal/js/tc39/README.md diff --git a/js/tc39/breaking_test_errors-experimental_enhanced.json b/internal/js/tc39/breaking_test_errors-experimental_enhanced.json similarity index 100% rename from js/tc39/breaking_test_errors-experimental_enhanced.json rename to internal/js/tc39/breaking_test_errors-experimental_enhanced.json diff --git a/js/tc39/breaking_test_errors-extended.json b/internal/js/tc39/breaking_test_errors-extended.json similarity index 100% rename from js/tc39/breaking_test_errors-extended.json rename to internal/js/tc39/breaking_test_errors-extended.json diff --git a/js/tc39/checkout.sh b/internal/js/tc39/checkout.sh similarity index 100% rename from js/tc39/checkout.sh rename to internal/js/tc39/checkout.sh diff --git a/js/tc39/tc39_norace_test.go b/internal/js/tc39/tc39_norace_test.go similarity index 100% rename from js/tc39/tc39_norace_test.go rename to internal/js/tc39/tc39_norace_test.go diff --git a/js/tc39/tc39_race_test.go b/internal/js/tc39/tc39_race_test.go similarity index 100% rename from js/tc39/tc39_race_test.go rename to internal/js/tc39/tc39_race_test.go diff --git a/js/tc39/tc39_test.go b/internal/js/tc39/tc39_test.go similarity index 99% rename from js/tc39/tc39_test.go rename to internal/js/tc39/tc39_test.go index 9098de9d3cc..314298b198f 100644 --- a/js/tc39/tc39_test.go +++ b/internal/js/tc39/tc39_test.go @@ -26,13 +26,13 @@ import ( "github.com/stretchr/testify/assert" "gopkg.in/yaml.v3" - "go.k6.io/k6/js/compiler" + "go.k6.io/k6/internal/js/compiler" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/js/modules" "go.k6.io/k6/js/modulestest" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/loader" - "go.k6.io/k6/usage" ) const ( diff --git a/js/timeout_error.go b/internal/js/timeout_error.go similarity index 100% rename from js/timeout_error.go rename to internal/js/timeout_error.go diff --git a/js/timeout_error_test.go b/internal/js/timeout_error_test.go similarity index 100% rename from js/timeout_error_test.go rename to internal/js/timeout_error_test.go diff --git a/lib/netext/grpcext/conn.go b/internal/lib/netext/grpcext/conn.go similarity index 100% rename from lib/netext/grpcext/conn.go rename to internal/lib/netext/grpcext/conn.go diff --git a/lib/netext/grpcext/conn_test.go b/internal/lib/netext/grpcext/conn_test.go similarity index 100% rename from lib/netext/grpcext/conn_test.go rename to internal/lib/netext/grpcext/conn_test.go diff --git a/lib/netext/grpcext/reflect.go b/internal/lib/netext/grpcext/reflect.go similarity index 100% rename from lib/netext/grpcext/reflect.go rename to internal/lib/netext/grpcext/reflect.go diff --git a/lib/netext/grpcext/stream.go b/internal/lib/netext/grpcext/stream.go similarity index 100% rename from lib/netext/grpcext/stream.go rename to internal/lib/netext/grpcext/stream.go diff --git a/lib/strvals/doc.go b/internal/lib/strvals/doc.go similarity index 100% rename from lib/strvals/doc.go rename to internal/lib/strvals/doc.go diff --git a/lib/strvals/parser.go b/internal/lib/strvals/parser.go similarity index 100% rename from lib/strvals/parser.go rename to internal/lib/strvals/parser.go diff --git a/lib/strvals/parser_test.go b/internal/lib/strvals/parser_test.go similarity index 100% rename from lib/strvals/parser_test.go rename to internal/lib/strvals/parser_test.go diff --git a/lib/testutils/fs.go b/internal/lib/testutils/fs.go similarity index 100% rename from lib/testutils/fs.go rename to internal/lib/testutils/fs.go diff --git a/lib/testutils/grpcservice/route_guide.pb.go b/internal/lib/testutils/grpcservice/route_guide.pb.go similarity index 100% rename from lib/testutils/grpcservice/route_guide.pb.go rename to internal/lib/testutils/grpcservice/route_guide.pb.go diff --git a/lib/testutils/grpcservice/route_guide.proto b/internal/lib/testutils/grpcservice/route_guide.proto similarity index 100% rename from lib/testutils/grpcservice/route_guide.proto rename to internal/lib/testutils/grpcservice/route_guide.proto diff --git a/lib/testutils/grpcservice/route_guide_grpc.pb.go b/internal/lib/testutils/grpcservice/route_guide_grpc.pb.go similarity index 100% rename from lib/testutils/grpcservice/route_guide_grpc.pb.go rename to internal/lib/testutils/grpcservice/route_guide_grpc.pb.go diff --git a/lib/testutils/grpcservice/service.go b/internal/lib/testutils/grpcservice/service.go similarity index 100% rename from lib/testutils/grpcservice/service.go rename to internal/lib/testutils/grpcservice/service.go diff --git a/lib/testutils/httpmultibin/grpc_any_testing/any_test.pb.go b/internal/lib/testutils/httpmultibin/grpc_any_testing/any_test.pb.go similarity index 100% rename from lib/testutils/httpmultibin/grpc_any_testing/any_test.pb.go rename to internal/lib/testutils/httpmultibin/grpc_any_testing/any_test.pb.go diff --git a/lib/testutils/httpmultibin/grpc_any_testing/any_test.proto b/internal/lib/testutils/httpmultibin/grpc_any_testing/any_test.proto similarity index 100% rename from lib/testutils/httpmultibin/grpc_any_testing/any_test.proto rename to internal/lib/testutils/httpmultibin/grpc_any_testing/any_test.proto diff --git a/lib/testutils/httpmultibin/grpc_protoset_testing/test.protoset b/internal/lib/testutils/httpmultibin/grpc_protoset_testing/test.protoset similarity index 100% rename from lib/testutils/httpmultibin/grpc_protoset_testing/test.protoset rename to internal/lib/testutils/httpmultibin/grpc_protoset_testing/test.protoset diff --git a/lib/testutils/httpmultibin/grpc_protoset_testing/test_message.proto b/internal/lib/testutils/httpmultibin/grpc_protoset_testing/test_message.proto similarity index 100% rename from lib/testutils/httpmultibin/grpc_protoset_testing/test_message.proto rename to internal/lib/testutils/httpmultibin/grpc_protoset_testing/test_message.proto diff --git a/lib/testutils/httpmultibin/grpc_protoset_testing/test_service.proto b/internal/lib/testutils/httpmultibin/grpc_protoset_testing/test_service.proto similarity index 100% rename from lib/testutils/httpmultibin/grpc_protoset_testing/test_service.proto rename to internal/lib/testutils/httpmultibin/grpc_protoset_testing/test_service.proto diff --git a/lib/testutils/httpmultibin/grpc_testing/nested_types.proto b/internal/lib/testutils/httpmultibin/grpc_testing/nested_types.proto similarity index 100% rename from lib/testutils/httpmultibin/grpc_testing/nested_types.proto rename to internal/lib/testutils/httpmultibin/grpc_testing/nested_types.proto diff --git a/lib/testutils/httpmultibin/grpc_testing/test.pb.go b/internal/lib/testutils/httpmultibin/grpc_testing/test.pb.go similarity index 100% rename from lib/testutils/httpmultibin/grpc_testing/test.pb.go rename to internal/lib/testutils/httpmultibin/grpc_testing/test.pb.go diff --git a/lib/testutils/httpmultibin/grpc_testing/test.proto b/internal/lib/testutils/httpmultibin/grpc_testing/test.proto similarity index 100% rename from lib/testutils/httpmultibin/grpc_testing/test.proto rename to internal/lib/testutils/httpmultibin/grpc_testing/test.proto diff --git a/lib/testutils/httpmultibin/grpc_testing/test_grpc.pb.go b/internal/lib/testutils/httpmultibin/grpc_testing/test_grpc.pb.go similarity index 100% rename from lib/testutils/httpmultibin/grpc_testing/test_grpc.pb.go rename to internal/lib/testutils/httpmultibin/grpc_testing/test_grpc.pb.go diff --git a/lib/testutils/httpmultibin/grpc_wrappers_testing/service.go b/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/service.go similarity index 100% rename from lib/testutils/httpmultibin/grpc_wrappers_testing/service.go rename to internal/lib/testutils/httpmultibin/grpc_wrappers_testing/service.go diff --git a/lib/testutils/httpmultibin/grpc_wrappers_testing/test.pb.go b/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test.pb.go similarity index 100% rename from lib/testutils/httpmultibin/grpc_wrappers_testing/test.pb.go rename to internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test.pb.go diff --git a/lib/testutils/httpmultibin/grpc_wrappers_testing/test.proto b/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test.proto similarity index 100% rename from lib/testutils/httpmultibin/grpc_wrappers_testing/test.proto rename to internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test.proto diff --git a/lib/testutils/httpmultibin/grpc_wrappers_testing/test_grpc.pb.go b/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test_grpc.pb.go similarity index 100% rename from lib/testutils/httpmultibin/grpc_wrappers_testing/test_grpc.pb.go rename to internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test_grpc.pb.go diff --git a/lib/testutils/httpmultibin/httpmultibin.go b/internal/lib/testutils/httpmultibin/httpmultibin.go similarity index 98% rename from lib/testutils/httpmultibin/httpmultibin.go rename to internal/lib/testutils/httpmultibin/httpmultibin.go index 36e4ad37387..80a38089747 100644 --- a/lib/testutils/httpmultibin/httpmultibin.go +++ b/internal/lib/testutils/httpmultibin/httpmultibin.go @@ -27,9 +27,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + grpcanytesting "go.k6.io/k6/internal/lib/testutils/httpmultibin/grpc_any_testing" + grpctest "go.k6.io/k6/internal/lib/testutils/httpmultibin/grpc_testing" "go.k6.io/k6/lib/netext" - grpcanytesting "go.k6.io/k6/lib/testutils/httpmultibin/grpc_any_testing" - grpctest "go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing" "go.k6.io/k6/lib/types" ) diff --git a/lib/testutils/httpmultibin/nested_types/nested_types.proto b/internal/lib/testutils/httpmultibin/nested_types/nested_types.proto similarity index 100% rename from lib/testutils/httpmultibin/nested_types/nested_types.proto rename to internal/lib/testutils/httpmultibin/nested_types/nested_types.proto diff --git a/lib/testutils/logrus_hook.go b/internal/lib/testutils/logrus_hook.go similarity index 100% rename from lib/testutils/logrus_hook.go rename to internal/lib/testutils/logrus_hook.go diff --git a/lib/testutils/minirunner/minirunner.go b/internal/lib/testutils/minirunner/minirunner.go similarity index 100% rename from lib/testutils/minirunner/minirunner.go rename to internal/lib/testutils/minirunner/minirunner.go diff --git a/lib/testutils/mockoutput/mockoutput.go b/internal/lib/testutils/mockoutput/mockoutput.go similarity index 100% rename from lib/testutils/mockoutput/mockoutput.go rename to internal/lib/testutils/mockoutput/mockoutput.go diff --git a/lib/testutils/mockresolver/resolver.go b/internal/lib/testutils/mockresolver/resolver.go similarity index 100% rename from lib/testutils/mockresolver/resolver.go rename to internal/lib/testutils/mockresolver/resolver.go diff --git a/lib/testutils/test_output.go b/internal/lib/testutils/test_output.go similarity index 100% rename from lib/testutils/test_output.go rename to internal/lib/testutils/test_output.go diff --git a/lib/testutils/untar.go b/internal/lib/testutils/untar.go similarity index 100% rename from lib/testutils/untar.go rename to internal/lib/testutils/untar.go diff --git a/lib/trace/doc.go b/internal/lib/trace/doc.go similarity index 100% rename from lib/trace/doc.go rename to internal/lib/trace/doc.go diff --git a/lib/trace/otel.go b/internal/lib/trace/otel.go similarity index 99% rename from lib/trace/otel.go rename to internal/lib/trace/otel.go index 447592236c0..e7040765449 100644 --- a/lib/trace/otel.go +++ b/internal/lib/trace/otel.go @@ -17,7 +17,7 @@ import ( "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/noop" - "go.k6.io/k6/lib/strvals" + "go.k6.io/k6/internal/lib/strvals" ) const serviceName = "k6" diff --git a/lib/trace/otel_test.go b/internal/lib/trace/otel_test.go similarity index 100% rename from lib/trace/otel_test.go rename to internal/lib/trace/otel_test.go diff --git a/loader/filesystems.go b/internal/loader/filesystems.go similarity index 100% rename from loader/filesystems.go rename to internal/loader/filesystems.go diff --git a/loader/loader.go b/internal/loader/loader.go similarity index 100% rename from loader/loader.go rename to internal/loader/loader.go diff --git a/loader/loader_test.go b/internal/loader/loader_test.go similarity index 98% rename from loader/loader_test.go rename to internal/loader/loader_test.go index 8c626c3eec2..48ecdbd869f 100644 --- a/loader/loader_test.go +++ b/internal/loader/loader_test.go @@ -11,10 +11,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" + "go.k6.io/k6/internal/loader" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" - "go.k6.io/k6/loader" ) func TestDir(t *testing.T) { diff --git a/loader/readsource.go b/internal/loader/readsource.go similarity index 100% rename from loader/readsource.go rename to internal/loader/readsource.go diff --git a/loader/readsource_test.go b/internal/loader/readsource_test.go similarity index 99% rename from loader/readsource_test.go rename to internal/loader/readsource_test.go index 8382cda1a6a..00eca176d97 100644 --- a/loader/readsource_test.go +++ b/internal/loader/readsource_test.go @@ -10,8 +10,8 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" ) type errorReader string diff --git a/log/file.go b/internal/log/file.go similarity index 99% rename from log/file.go rename to internal/log/file.go index 626423df683..e4ea1f99cc4 100644 --- a/log/file.go +++ b/internal/log/file.go @@ -12,8 +12,8 @@ import ( "syscall" "github.com/sirupsen/logrus" + "go.k6.io/k6/internal/lib/strvals" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/strvals" ) // fileHookBufferSize is a default size for the fileHook's loglines channel. diff --git a/log/file_test.go b/internal/log/file_test.go similarity index 100% rename from log/file_test.go rename to internal/log/file_test.go diff --git a/log/levels.go b/internal/log/levels.go similarity index 100% rename from log/levels.go rename to internal/log/levels.go diff --git a/log/levels_test.go b/internal/log/levels_test.go similarity index 100% rename from log/levels_test.go rename to internal/log/levels_test.go diff --git a/log/log.go b/internal/log/log.go similarity index 100% rename from log/log.go rename to internal/log/log.go diff --git a/log/loki.go b/internal/log/loki.go similarity index 99% rename from log/loki.go rename to internal/log/loki.go index 2a3c9bc1fed..9810d685dfa 100644 --- a/log/loki.go +++ b/internal/log/loki.go @@ -13,7 +13,7 @@ import ( "time" "github.com/sirupsen/logrus" - "go.k6.io/k6/lib/strvals" + "go.k6.io/k6/internal/lib/strvals" ) // lokiHook is a Logrus hook for flushing to Loki. diff --git a/log/loki_test.go b/internal/log/loki_test.go similarity index 100% rename from log/loki_test.go rename to internal/log/loki_test.go diff --git a/metrics/engine/engine.go b/internal/metrics/engine/engine.go similarity index 100% rename from metrics/engine/engine.go rename to internal/metrics/engine/engine.go diff --git a/metrics/engine/engine_test.go b/internal/metrics/engine/engine_test.go similarity index 99% rename from metrics/engine/engine_test.go rename to internal/metrics/engine/engine_test.go index a941b4671b8..49c4c09b8da 100644 --- a/metrics/engine/engine_test.go +++ b/internal/metrics/engine/engine_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/metrics" ) diff --git a/metrics/engine/ingester.go b/internal/metrics/engine/ingester.go similarity index 100% rename from metrics/engine/ingester.go rename to internal/metrics/engine/ingester.go diff --git a/metrics/engine/ingester_test.go b/internal/metrics/engine/ingester_test.go similarity index 99% rename from metrics/engine/ingester_test.go rename to internal/metrics/engine/ingester_test.go index a6466ffee2f..6e9537a9a04 100644 --- a/metrics/engine/ingester_test.go +++ b/internal/metrics/engine/ingester_test.go @@ -7,8 +7,8 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/metrics" ) diff --git a/output/cloud/expv2/integration/integration_test.go b/internal/output/cloud/expv2/integration/integration_test.go similarity index 98% rename from output/cloud/expv2/integration/integration_test.go rename to internal/output/cloud/expv2/integration/integration_test.go index 2d38810f3b1..feca672fcfc 100644 --- a/output/cloud/expv2/integration/integration_test.go +++ b/internal/output/cloud/expv2/integration/integration_test.go @@ -14,11 +14,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.k6.io/k6/cloudapi" - "go.k6.io/k6/lib/testutils" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/output/cloud/expv2/pbcloud" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" "go.k6.io/k6/output/cloud/expv2" - "go.k6.io/k6/output/cloud/expv2/pbcloud" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" "gopkg.in/guregu/null.v3" diff --git a/output/cloud/expv2/integration/testdata/metricset.json b/internal/output/cloud/expv2/integration/testdata/metricset.json similarity index 100% rename from output/cloud/expv2/integration/testdata/metricset.json rename to internal/output/cloud/expv2/integration/testdata/metricset.json diff --git a/output/cloud/expv2/pbcloud/gen.go b/internal/output/cloud/expv2/pbcloud/gen.go similarity index 100% rename from output/cloud/expv2/pbcloud/gen.go rename to internal/output/cloud/expv2/pbcloud/gen.go diff --git a/output/cloud/expv2/pbcloud/metric.pb.go b/internal/output/cloud/expv2/pbcloud/metric.pb.go similarity index 100% rename from output/cloud/expv2/pbcloud/metric.pb.go rename to internal/output/cloud/expv2/pbcloud/metric.pb.go diff --git a/output/cloud/expv2/pbcloud/metric.proto b/internal/output/cloud/expv2/pbcloud/metric.proto similarity index 100% rename from output/cloud/expv2/pbcloud/metric.proto rename to internal/output/cloud/expv2/pbcloud/metric.proto diff --git a/output/cloud/insights/collect.go b/internal/output/cloud/insights/collect.go similarity index 98% rename from output/cloud/insights/collect.go rename to internal/output/cloud/insights/collect.go index 53e1724f26c..66d8aa271b1 100644 --- a/output/cloud/insights/collect.go +++ b/internal/output/cloud/insights/collect.go @@ -4,7 +4,7 @@ import ( "strconv" "sync" - "go.k6.io/k6/cloudapi/insights" + "go.k6.io/k6/internal/cloudapi/insights" "go.k6.io/k6/lib/netext/httpext" "go.k6.io/k6/metrics" ) diff --git a/output/cloud/insights/collect_test.go b/internal/output/cloud/insights/collect_test.go similarity index 99% rename from output/cloud/insights/collect_test.go rename to internal/output/cloud/insights/collect_test.go index 6350dc8eb76..08cf324512f 100644 --- a/output/cloud/insights/collect_test.go +++ b/internal/output/cloud/insights/collect_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "go.k6.io/k6/cloudapi/insights" + "go.k6.io/k6/internal/cloudapi/insights" "go.k6.io/k6/lib/netext/httpext" "go.k6.io/k6/metrics" ) diff --git a/output/cloud/insights/doc.go b/internal/output/cloud/insights/doc.go similarity index 100% rename from output/cloud/insights/doc.go rename to internal/output/cloud/insights/doc.go diff --git a/output/cloud/insights/enable.go b/internal/output/cloud/insights/enable.go similarity index 100% rename from output/cloud/insights/enable.go rename to internal/output/cloud/insights/enable.go diff --git a/output/cloud/insights/flush.go b/internal/output/cloud/insights/flush.go similarity index 96% rename from output/cloud/insights/flush.go rename to internal/output/cloud/insights/flush.go index 57bb4a0c8cb..449fe5504a8 100644 --- a/output/cloud/insights/flush.go +++ b/internal/output/cloud/insights/flush.go @@ -3,7 +3,7 @@ package insights import ( "context" - "go.k6.io/k6/cloudapi/insights" + "go.k6.io/k6/internal/cloudapi/insights" ) // Client is an interface for sending request metadatas to the Insights API. diff --git a/output/cloud/insights/flush_test.go b/internal/output/cloud/insights/flush_test.go similarity index 98% rename from output/cloud/insights/flush_test.go rename to internal/output/cloud/insights/flush_test.go index 3ee049281c3..f67333bc3aa 100644 --- a/output/cloud/insights/flush_test.go +++ b/internal/output/cloud/insights/flush_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" - "go.k6.io/k6/cloudapi/insights" + "go.k6.io/k6/internal/cloudapi/insights" "go.k6.io/k6/metrics" ) diff --git a/output/cloud/output.go b/internal/output/cloud/output.go similarity index 99% rename from output/cloud/output.go rename to internal/output/cloud/output.go index 1d877d526cf..226e39fc8f7 100644 --- a/output/cloud/output.go +++ b/internal/output/cloud/output.go @@ -13,12 +13,12 @@ import ( "go.k6.io/k6/cloudapi" "go.k6.io/k6/errext" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" "go.k6.io/k6/lib/consts" "go.k6.io/k6/metrics" "go.k6.io/k6/output" cloudv2 "go.k6.io/k6/output/cloud/expv2" - "go.k6.io/k6/usage" ) const ( diff --git a/output/cloud/output_test.go b/internal/output/cloud/output_test.go similarity index 99% rename from output/cloud/output_test.go rename to internal/output/cloud/output_test.go index 578d7b7ee05..e170f85529a 100644 --- a/output/cloud/output_test.go +++ b/internal/output/cloud/output_test.go @@ -14,13 +14,13 @@ import ( "github.com/stretchr/testify/require" "go.k6.io/k6/cloudapi" "go.k6.io/k6/errext" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" "go.k6.io/k6/output" cloudv2 "go.k6.io/k6/output/cloud/expv2" - "go.k6.io/k6/usage" "gopkg.in/guregu/null.v3" ) diff --git a/output/influxdb/bench_test.go b/internal/output/influxdb/bench_test.go similarity index 100% rename from output/influxdb/bench_test.go rename to internal/output/influxdb/bench_test.go diff --git a/output/influxdb/config.go b/internal/output/influxdb/config.go similarity index 100% rename from output/influxdb/config.go rename to internal/output/influxdb/config.go diff --git a/output/influxdb/config_test.go b/internal/output/influxdb/config_test.go similarity index 100% rename from output/influxdb/config_test.go rename to internal/output/influxdb/config_test.go diff --git a/output/influxdb/output.go b/internal/output/influxdb/output.go similarity index 100% rename from output/influxdb/output.go rename to internal/output/influxdb/output.go diff --git a/output/influxdb/output_test.go b/internal/output/influxdb/output_test.go similarity index 99% rename from output/influxdb/output_test.go rename to internal/output/influxdb/output_test.go index 2aee1177325..7adc0d5f41c 100644 --- a/output/influxdb/output_test.go +++ b/internal/output/influxdb/output_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/lib/testutils" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/metrics" "go.k6.io/k6/output" ) diff --git a/output/influxdb/util.go b/internal/output/influxdb/util.go similarity index 100% rename from output/influxdb/util.go rename to internal/output/influxdb/util.go diff --git a/output/influxdb/util_test.go b/internal/output/influxdb/util_test.go similarity index 100% rename from output/influxdb/util_test.go rename to internal/output/influxdb/util_test.go diff --git a/output/json/benchmark_test.go b/internal/output/json/benchmark_test.go similarity index 95% rename from output/json/benchmark_test.go rename to internal/output/json/benchmark_test.go index 1273486a9fe..4ac5a4ce761 100644 --- a/output/json/benchmark_test.go +++ b/internal/output/json/benchmark_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/output" ) diff --git a/output/json/json.go b/internal/output/json/json.go similarity index 100% rename from output/json/json.go rename to internal/output/json/json.go diff --git a/output/json/json_easyjson.go b/internal/output/json/json_easyjson.go similarity index 100% rename from output/json/json_easyjson.go rename to internal/output/json/json_easyjson.go diff --git a/output/json/json_test.go b/internal/output/json/json_test.go similarity index 99% rename from output/json/json_test.go rename to internal/output/json/json_test.go index 4f72da27191..02b3695ea6f 100644 --- a/output/json/json_test.go +++ b/internal/output/json/json_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/metrics" "go.k6.io/k6/output" ) diff --git a/output/json/wrapper.go b/internal/output/json/wrapper.go similarity index 100% rename from output/json/wrapper.go rename to internal/output/json/wrapper.go diff --git a/ui/console/doc.go b/internal/ui/console/doc.go similarity index 100% rename from ui/console/doc.go rename to internal/ui/console/doc.go diff --git a/ui/console/writer.go b/internal/ui/console/writer.go similarity index 100% rename from ui/console/writer.go rename to internal/ui/console/writer.go diff --git a/ui/doc.go b/internal/ui/doc.go similarity index 100% rename from ui/doc.go rename to internal/ui/doc.go diff --git a/ui/form.go b/internal/ui/form.go similarity index 100% rename from ui/form.go rename to internal/ui/form.go diff --git a/ui/form_fields.go b/internal/ui/form_fields.go similarity index 100% rename from ui/form_fields.go rename to internal/ui/form_fields.go diff --git a/ui/form_fields_test.go b/internal/ui/form_fields_test.go similarity index 100% rename from ui/form_fields_test.go rename to internal/ui/form_fields_test.go diff --git a/ui/form_test.go b/internal/ui/form_test.go similarity index 100% rename from ui/form_test.go rename to internal/ui/form_test.go diff --git a/ui/pb/doc.go b/internal/ui/pb/doc.go similarity index 100% rename from ui/pb/doc.go rename to internal/ui/pb/doc.go diff --git a/ui/pb/helpers.go b/internal/ui/pb/helpers.go similarity index 100% rename from ui/pb/helpers.go rename to internal/ui/pb/helpers.go diff --git a/ui/pb/helpers_test.go b/internal/ui/pb/helpers_test.go similarity index 100% rename from ui/pb/helpers_test.go rename to internal/ui/pb/helpers_test.go diff --git a/ui/pb/progressbar.go b/internal/ui/pb/progressbar.go similarity index 100% rename from ui/pb/progressbar.go rename to internal/ui/pb/progressbar.go diff --git a/ui/pb/progressbar_test.go b/internal/ui/pb/progressbar_test.go similarity index 100% rename from ui/pb/progressbar_test.go rename to internal/ui/pb/progressbar_test.go diff --git a/usage/usage.go b/internal/usage/usage.go similarity index 100% rename from usage/usage.go rename to internal/usage/usage.go diff --git a/usage/usage_test.go b/internal/usage/usage_test.go similarity index 100% rename from usage/usage_test.go rename to internal/usage/usage_test.go diff --git a/js/common/event.go b/js/common/event.go index d561c09b812..551fbf919a9 100644 --- a/js/common/event.go +++ b/js/common/event.go @@ -1,6 +1,6 @@ package common -import "go.k6.io/k6/event" +import "go.k6.io/k6/internal/event" // Events are the event subscriber interfaces for the global event system, and // the local (per-VU) event system. diff --git a/js/modules/k6/http/request_test.go b/js/modules/k6/http/request_test.go index 42d6cccd0f5..bd3a69eb317 100644 --- a/js/modules/k6/http/request_test.go +++ b/js/modules/k6/http/request_test.go @@ -36,11 +36,11 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" "go.k6.io/k6/js/modulestest" "go.k6.io/k6/lib" "go.k6.io/k6/lib/netext" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" "go.k6.io/k6/metrics" ) diff --git a/js/modules/k6/marshalling_test.go b/js/modules/k6/marshalling_test.go index 6932c65e67e..4857390d173 100644 --- a/js/modules/k6/marshalling_test.go +++ b/js/modules/k6/marshalling_test.go @@ -9,14 +9,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/js" + "go.k6.io/k6/internal/js" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/httpmultibin" "go.k6.io/k6/lib/types" - "go.k6.io/k6/loader" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) func TestSetupDataMarshalling(t *testing.T) { diff --git a/js/modules/require_impl.go b/js/modules/require_impl.go index 3131e11e0a4..71098ec3754 100644 --- a/js/modules/require_impl.go +++ b/js/modules/require_impl.go @@ -8,7 +8,7 @@ import ( "github.com/grafana/sobek" - "go.k6.io/k6/loader" + "go.k6.io/k6/internal/loader" ) // Require is the actual call that implements require @@ -202,7 +202,7 @@ func getPreviousRequiringFile(vu VU) (string, error) { for i, frame := range frames[1:] { // first one should be the current require // TODO have this precalculated automatically - if frame.FuncName() == "go.k6.io/k6/js.(*requireImpl).require-fm" { + if frame.FuncName() == "go.k6.io/k6/internal/js.(*requireImpl).require-fm" { // we need to get the one *before* but as we skip the first one the index matches ;) result := frames[i].SrcName() if result == "file:///-" { diff --git a/js/modules/resolution.go b/js/modules/resolution.go index ed5015d6ca6..84d684b9c5a 100644 --- a/js/modules/resolution.go +++ b/js/modules/resolution.go @@ -9,9 +9,9 @@ import ( "github.com/grafana/sobek/ast" "github.com/sirupsen/logrus" - "go.k6.io/k6/js/compiler" - "go.k6.io/k6/loader" - "go.k6.io/k6/usage" + "go.k6.io/k6/internal/js/compiler" + "go.k6.io/k6/internal/loader" + "go.k6.io/k6/internal/usage" ) const notPreviouslyResolvedModule = "the module %q was not previously resolved during initialization (__VU==0)" diff --git a/js/modulestest/runtime.go b/js/modulestest/runtime.go index 6251fd752b5..da714d947a6 100644 --- a/js/modulestest/runtime.go +++ b/js/modulestest/runtime.go @@ -7,15 +7,15 @@ import ( "testing" "github.com/grafana/sobek" + "go.k6.io/k6/internal/js/compiler" + "go.k6.io/k6/internal/js/eventloop" + "go.k6.io/k6/internal/js/modules/k6/timers" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/js/common" - "go.k6.io/k6/js/compiler" - "go.k6.io/k6/js/eventloop" "go.k6.io/k6/js/modules" - "go.k6.io/k6/js/modules/k6/timers" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) // Runtime is a helper struct that contains what is needed to run a (simple) module test diff --git a/lib/archive.go b/lib/archive.go index 0ca6ff47825..c855f2a55b5 100644 --- a/lib/archive.go +++ b/lib/archive.go @@ -16,8 +16,8 @@ import ( "strings" "time" + "go.k6.io/k6/internal/loader" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/loader" ) var ( diff --git a/lib/archive_test.go b/lib/archive_test.go index 9bb86c9ed7e..9da014800c7 100644 --- a/lib/archive_test.go +++ b/lib/archive_test.go @@ -10,7 +10,7 @@ import ( "runtime" "testing" - "go.k6.io/k6/lib/testutils" + "go.k6.io/k6/internal/lib/testutils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/lib/executor/base_executor.go b/lib/executor/base_executor.go index 9f9ec21d85f..90d5cd29816 100644 --- a/lib/executor/base_executor.go +++ b/lib/executor/base_executor.go @@ -8,9 +8,9 @@ import ( "github.com/sirupsen/logrus" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) // BaseExecutor is a helper struct that contains common properties and methods diff --git a/lib/executor/common_test.go b/lib/executor/common_test.go index 3ac6d6e69fb..ac734518a84 100644 --- a/lib/executor/common_test.go +++ b/lib/executor/common_test.go @@ -8,9 +8,9 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/minirunner" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/minirunner" "go.k6.io/k6/metrics" ) diff --git a/lib/executor/constant_arrival_rate.go b/lib/executor/constant_arrival_rate.go index 1675d6eaa2c..66f201aa99a 100644 --- a/lib/executor/constant_arrival_rate.go +++ b/lib/executor/constant_arrival_rate.go @@ -12,10 +12,10 @@ import ( "github.com/sirupsen/logrus" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) const constantArrivalRateType = "constant-arrival-rate" diff --git a/lib/executor/constant_vus.go b/lib/executor/constant_vus.go index b0a8ca690f4..9be925809c5 100644 --- a/lib/executor/constant_vus.go +++ b/lib/executor/constant_vus.go @@ -9,10 +9,10 @@ import ( "github.com/sirupsen/logrus" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) const constantVUsType = "constant-vus" diff --git a/lib/executor/execution_test.go b/lib/executor/execution_test.go index 7547ff43a78..a2fdb4998a3 100644 --- a/lib/executor/execution_test.go +++ b/lib/executor/execution_test.go @@ -13,9 +13,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/minirunner" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/minirunner" ) func TestExecutionStateVUIDs(t *testing.T) { diff --git a/lib/executor/executors_test.go b/lib/executor/executors_test.go index b39d0e84763..0da9ef6e888 100644 --- a/lib/executor/executors_test.go +++ b/lib/executor/executors_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "go.k6.io/k6/lib/testutils" + "go.k6.io/k6/internal/lib/testutils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/lib/executor/externally_controlled.go b/lib/executor/externally_controlled.go index 7f0c876b89f..7cf456ec792 100644 --- a/lib/executor/externally_controlled.go +++ b/lib/executor/externally_controlled.go @@ -12,10 +12,10 @@ import ( "github.com/sirupsen/logrus" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) const externallyControlledType = "externally-controlled" diff --git a/lib/executor/helpers.go b/lib/executor/helpers.go index ae513770342..a62a5349c5a 100644 --- a/lib/executor/helpers.go +++ b/lib/executor/helpers.go @@ -10,10 +10,10 @@ import ( "github.com/sirupsen/logrus" "go.k6.io/k6/errext" - "go.k6.io/k6/execution" + "go.k6.io/k6/internal/execution" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/types" - "go.k6.io/k6/ui/pb" ) const ( diff --git a/lib/executor/per_vu_iterations.go b/lib/executor/per_vu_iterations.go index 94159bbfb88..15f66cbf189 100644 --- a/lib/executor/per_vu_iterations.go +++ b/lib/executor/per_vu_iterations.go @@ -10,10 +10,10 @@ import ( "github.com/sirupsen/logrus" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) const perVUIterationsType = "per-vu-iterations" diff --git a/lib/executor/ramping_arrival_rate.go b/lib/executor/ramping_arrival_rate.go index 84fd89fb735..0dd60c45a91 100644 --- a/lib/executor/ramping_arrival_rate.go +++ b/lib/executor/ramping_arrival_rate.go @@ -11,10 +11,10 @@ import ( "github.com/sirupsen/logrus" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) const rampingArrivalRateType = "ramping-arrival-rate" diff --git a/lib/executor/ramping_vus.go b/lib/executor/ramping_vus.go index e95c79fff77..78fb54c2bbb 100644 --- a/lib/executor/ramping_vus.go +++ b/lib/executor/ramping_vus.go @@ -10,10 +10,10 @@ import ( "github.com/sirupsen/logrus" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) const rampingVUsType = "ramping-vus" diff --git a/lib/executor/shared_iterations.go b/lib/executor/shared_iterations.go index c1ec7910648..504e4ab1a3e 100644 --- a/lib/executor/shared_iterations.go +++ b/lib/executor/shared_iterations.go @@ -10,10 +10,10 @@ import ( "github.com/sirupsen/logrus" "gopkg.in/guregu/null.v3" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/lib" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) const sharedIterationsType = "shared-iterations" diff --git a/lib/executor/vu_handle_test.go b/lib/executor/vu_handle_test.go index 623e768cc88..191bc06eb6a 100644 --- a/lib/executor/vu_handle_test.go +++ b/lib/executor/vu_handle_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/lib/testutils/minirunner" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils" - "go.k6.io/k6/lib/testutils/minirunner" "go.k6.io/k6/metrics" ) diff --git a/lib/executors.go b/lib/executors.go index 61067382491..11d8733f01d 100644 --- a/lib/executors.go +++ b/lib/executors.go @@ -11,8 +11,8 @@ import ( "github.com/sirupsen/logrus" + "go.k6.io/k6/internal/ui/pb" "go.k6.io/k6/metrics" - "go.k6.io/k6/ui/pb" ) // TODO: remove globals and use some type of explicit dependency injection? diff --git a/lib/netext/dialer_test.go b/lib/netext/dialer_test.go index 4955c4d304a..d87e4fe50b2 100644 --- a/lib/netext/dialer_test.go +++ b/lib/netext/dialer_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils/mockresolver" "go.k6.io/k6/lib" - "go.k6.io/k6/lib/testutils/mockresolver" "go.k6.io/k6/lib/types" ) diff --git a/lib/netext/httpext/error_codes_test.go b/lib/netext/httpext/error_codes_test.go index 1b0ce9ff8fc..c5df6bf18e4 100644 --- a/lib/netext/httpext/error_codes_test.go +++ b/lib/netext/httpext/error_codes_test.go @@ -21,8 +21,8 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/net/http2" + "go.k6.io/k6/internal/lib/testutils/httpmultibin" "go.k6.io/k6/lib/netext" - "go.k6.io/k6/lib/testutils/httpmultibin" "go.k6.io/k6/lib/types" ) diff --git a/lib/netext/resolver_test.go b/lib/netext/resolver_test.go index df659c04f45..664dc9b8aea 100644 --- a/lib/netext/resolver_test.go +++ b/lib/netext/resolver_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/lib/testutils/mockresolver" + "go.k6.io/k6/internal/lib/testutils/mockresolver" "go.k6.io/k6/lib/types" ) diff --git a/lib/old_archive_test.go b/lib/old_archive_test.go index d4824e65fa1..e9232dd8e06 100644 --- a/lib/old_archive_test.go +++ b/lib/old_archive_test.go @@ -9,7 +9,7 @@ import ( "path/filepath" "testing" - "go.k6.io/k6/lib/testutils" + "go.k6.io/k6/internal/lib/testutils" "github.com/stretchr/testify/require" diff --git a/lib/test_state.go b/lib/test_state.go index 28a27885483..0a576217258 100644 --- a/lib/test_state.go +++ b/lib/test_state.go @@ -6,10 +6,10 @@ import ( "sync/atomic" "github.com/sirupsen/logrus" - "go.k6.io/k6/event" - "go.k6.io/k6/lib/trace" + "go.k6.io/k6/internal/event" + "go.k6.io/k6/internal/lib/trace" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) // TestPreInitState contains all of the state that can be gathered and built diff --git a/lib/vu_state.go b/lib/vu_state.go index a59b39cf38f..9c7c3a31f75 100644 --- a/lib/vu_state.go +++ b/lib/vu_state.go @@ -12,8 +12,8 @@ import ( "go.opentelemetry.io/otel/trace" "golang.org/x/time/rate" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) // DialContexter is an interface that can dial with a context diff --git a/output/cloud/expv2/flush.go b/output/cloud/expv2/flush.go index 09b37633015..409052d7007 100644 --- a/output/cloud/expv2/flush.go +++ b/output/cloud/expv2/flush.go @@ -5,8 +5,8 @@ import ( "github.com/sirupsen/logrus" + "go.k6.io/k6/internal/output/cloud/expv2/pbcloud" "go.k6.io/k6/metrics" - "go.k6.io/k6/output/cloud/expv2/pbcloud" ) type pusher interface { diff --git a/output/cloud/expv2/flush_test.go b/output/cloud/expv2/flush_test.go index 5ff236c9f54..2293c1adad5 100644 --- a/output/cloud/expv2/flush_test.go +++ b/output/cloud/expv2/flush_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/lib/testutils" + "go.k6.io/k6/internal/lib/testutils" + "go.k6.io/k6/internal/output/cloud/expv2/pbcloud" "go.k6.io/k6/metrics" - "go.k6.io/k6/output/cloud/expv2/pbcloud" ) // TODO: additional case diff --git a/output/cloud/expv2/hdr.go b/output/cloud/expv2/hdr.go index 4a72649d500..acb750d56d9 100644 --- a/output/cloud/expv2/hdr.go +++ b/output/cloud/expv2/hdr.go @@ -5,7 +5,7 @@ import ( "math/bits" "sort" - "go.k6.io/k6/output/cloud/expv2/pbcloud" + "go.k6.io/k6/internal/output/cloud/expv2/pbcloud" ) const ( diff --git a/output/cloud/expv2/hdr_test.go b/output/cloud/expv2/hdr_test.go index a7dacbaf7ea..c17811ff920 100644 --- a/output/cloud/expv2/hdr_test.go +++ b/output/cloud/expv2/hdr_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.k6.io/k6/output/cloud/expv2/pbcloud" + "go.k6.io/k6/internal/output/cloud/expv2/pbcloud" "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/output/cloud/expv2/mapping.go b/output/cloud/expv2/mapping.go index ee16ee42c14..5e5585880ce 100644 --- a/output/cloud/expv2/mapping.go +++ b/output/cloud/expv2/mapping.go @@ -5,8 +5,8 @@ import ( "strings" "github.com/mstoykov/atlas" + "go.k6.io/k6/internal/output/cloud/expv2/pbcloud" "go.k6.io/k6/metrics" - "go.k6.io/k6/output/cloud/expv2/pbcloud" "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/output/cloud/expv2/metrics_client.go b/output/cloud/expv2/metrics_client.go index c9d59cefc52..e46f13cf043 100644 --- a/output/cloud/expv2/metrics_client.go +++ b/output/cloud/expv2/metrics_client.go @@ -13,7 +13,7 @@ import ( "google.golang.org/protobuf/proto" "go.k6.io/k6/cloudapi" - "go.k6.io/k6/output/cloud/expv2/pbcloud" + "go.k6.io/k6/internal/output/cloud/expv2/pbcloud" ) // metricsClient is a Protobuf over HTTP client for sending diff --git a/output/cloud/expv2/metrics_client_test.go b/output/cloud/expv2/metrics_client_test.go index 64517b8f15e..bf098d96b5e 100644 --- a/output/cloud/expv2/metrics_client_test.go +++ b/output/cloud/expv2/metrics_client_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.k6.io/k6/cloudapi" - "go.k6.io/k6/output/cloud/expv2/pbcloud" + "go.k6.io/k6/internal/output/cloud/expv2/pbcloud" ) func TestMetricsClientPush(t *testing.T) { diff --git a/output/cloud/expv2/output.go b/output/cloud/expv2/output.go index b4f66097430..896d8574863 100644 --- a/output/cloud/expv2/output.go +++ b/output/cloud/expv2/output.go @@ -12,13 +12,13 @@ import ( "time" "go.k6.io/k6/cloudapi" - "go.k6.io/k6/cloudapi/insights" "go.k6.io/k6/errext" "go.k6.io/k6/errext/exitcodes" + "go.k6.io/k6/internal/cloudapi/insights" + insightsOutput "go.k6.io/k6/internal/output/cloud/insights" "go.k6.io/k6/lib/consts" "go.k6.io/k6/metrics" "go.k6.io/k6/output" - insightsOutput "go.k6.io/k6/output/cloud/insights" "github.com/sirupsen/logrus" ) diff --git a/output/cloud/expv2/output_test.go b/output/cloud/expv2/output_test.go index 2956f63c3b0..ab946df267a 100644 --- a/output/cloud/expv2/output_test.go +++ b/output/cloud/expv2/output_test.go @@ -14,7 +14,7 @@ import ( "gopkg.in/guregu/null.v3" "go.k6.io/k6/cloudapi" - "go.k6.io/k6/lib/testutils" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib/types" "go.k6.io/k6/metrics" ) diff --git a/output/csv/output_test.go b/output/csv/output_test.go index ff7f4fffdff..3162e95f15f 100644 --- a/output/csv/output_test.go +++ b/output/csv/output_test.go @@ -14,9 +14,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.k6.io/k6/internal/lib/testutils" "go.k6.io/k6/lib" "go.k6.io/k6/lib/fsext" - "go.k6.io/k6/lib/testutils" "go.k6.io/k6/metrics" "go.k6.io/k6/output" ) diff --git a/output/types.go b/output/types.go index 645015979c3..7eb46a29a75 100644 --- a/output/types.go +++ b/output/types.go @@ -10,10 +10,10 @@ import ( "github.com/sirupsen/logrus" + "go.k6.io/k6/internal/usage" "go.k6.io/k6/lib" "go.k6.io/k6/lib/fsext" "go.k6.io/k6/metrics" - "go.k6.io/k6/usage" ) // Params contains all possible constructor parameters an output may need.