forked from parseablehq/quest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Organise files wrt Go native approach (parseablehq#36)
- Loading branch information
Showing
27 changed files
with
414 additions
and
855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ jobs: | |
uses: contributor-assistant/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# the below token should have repo scope and must be manually added by you in the repository's secret | ||
# This token is required only if you have configured to store the signatures in a remote repository/organization | ||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
with: | ||
remote-organization-name: 'parseablehq' # enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository) | ||
|
@@ -40,5 +42,4 @@ jobs: | |
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA' | ||
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.' | ||
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true) | ||
#use-dco-flag: true - If you are using DCO instead of CLA | ||
|
||
#use-dco-flag: true - If you are using DCO instead of CLA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd | ||
// | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os/exec" | ||
"testing" | ||
) | ||
|
||
const ( | ||
vus = "10" | ||
duration = "5m" | ||
schema_count = "20" | ||
) | ||
|
||
func TestStreamBatchLoadWithK6(t *testing.T) { | ||
if NewGlob.Mode == "load" { | ||
CreateStream(t, NewGlob.Client, NewGlob.Stream) | ||
cmd := exec.Command("k6", | ||
"run", | ||
"-e", fmt.Sprintf("P_URL=%s", NewGlob.Url.String()), | ||
"-e", fmt.Sprintf("P_USERNAME=%s", NewGlob.Username), | ||
"-e", fmt.Sprintf("P_PASSWORD=%s", NewGlob.Password), | ||
"-e", fmt.Sprintf("P_STREAM=%s", NewGlob.Stream), | ||
"-e", fmt.Sprintf("P_SCHEMA_COUNT=%s", schema_count), | ||
"./scripts/load_batch_events.js", | ||
"--vus=", vus, | ||
"--duration=", duration) | ||
|
||
cmd.Run() | ||
op, err := cmd.Output() | ||
if err != nil { | ||
t.Log(err) | ||
} | ||
t.Log(string(op)) | ||
} | ||
} | ||
|
||
func TestStreamLoadWithK6(t *testing.T) { | ||
if NewGlob.Mode == "load" { | ||
cmd := exec.Command("k6", | ||
"run", | ||
"-e", fmt.Sprintf("P_URL=%s", NewGlob.Url.String()), | ||
"-e", fmt.Sprintf("P_USERNAME=%s", NewGlob.Username), | ||
"-e", fmt.Sprintf("P_PASSWORD=%s", NewGlob.Password), | ||
"-e", fmt.Sprintf("P_STREAM=%s", NewGlob.Stream), | ||
"-e", fmt.Sprintf("P_SCHEMA_COUNT=%s", schema_count), | ||
"./scripts/load_single_events.js", | ||
"--vus=", vus, | ||
"--duration=", duration) | ||
|
||
cmd.Run() | ||
op, err := cmd.Output() | ||
if err != nil { | ||
t.Log(err) | ||
} | ||
t.Log(string(op)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd | ||
// | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
"net/url" | ||
"testing" | ||
) | ||
|
||
func main() { | ||
println("hello") | ||
} | ||
|
||
type Glob struct { | ||
Url url.URL | ||
Username string | ||
Password string | ||
Stream string | ||
Client HTTPClient | ||
Mode string | ||
} | ||
|
||
var NewGlob = func() Glob { | ||
testing.Init() | ||
var targetUrl string | ||
var username string | ||
var password string | ||
var stream string | ||
var mode string | ||
|
||
flag.StringVar(&targetUrl, "url", "http://localhost:8000", "Specify url. Default is root") | ||
flag.StringVar(&username, "user", "admin", "Specify username. Default is admin") | ||
flag.StringVar(&password, "pass", "admin", "Specify pass. Default is admin") | ||
flag.StringVar(&stream, "stream", "app", "Specify stream. Default is app") | ||
flag.StringVar(&mode, "mode", "smoke", "Specify mode. Default is smoke") | ||
|
||
flag.Parse() | ||
|
||
parsedTargetUrl, err := url.Parse(targetUrl) | ||
if err != nil { | ||
panic("Could not parse url") | ||
} | ||
|
||
client := DefaultClient(*parsedTargetUrl, username, password) | ||
|
||
return Glob{ | ||
Url: *parsedTargetUrl, | ||
Username: username, | ||
Password: password, | ||
Stream: stream, | ||
Client: client, | ||
Mode: mode, | ||
} | ||
}() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.