-
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.
Merge branch 'master' into k6-squash
- Loading branch information
Showing
17 changed files
with
5,001 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
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,2 @@ | ||
dist | ||
node_modules |
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 @@ | ||
{} |
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,50 @@ | ||
.DEFAULT_GOAL := build | ||
ifeq (, $(shell which node)) | ||
NODE_INSTALLED=false | ||
else | ||
NODE_INSTALLED=true | ||
endif | ||
|
||
.PHONY: check-node-installed | ||
check-node-installed: | ||
@$(NODE_INSTALLED) || echo NodeJS is not installed. Call "make install" to install | ||
|
||
.PHONY: build | ||
build: clean check-node-installed node-modules | ||
npm run bundle | ||
|
||
.PHONY: build-dev | ||
build-dev: export WEBPACK_DEVTOOL=source-map | ||
build-dev: build | ||
|
||
AWS_ACCOUNT_ID:=$(shell aws sts get-caller-identity --query "Account" --output text) | ||
.PHONY: run | ||
run: build | ||
AWS_ACCOUNT_ID=$(AWS_ACCOUNT_ID) ./run-test.sh | ||
|
||
.PHONY: run-dev | ||
run-dev: export WEBPACK_DEVTOOL=source-map | ||
run-dev: run | ||
|
||
.PHONY: node-modules | ||
node-modules: | ||
npm install | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf dist | ||
|
||
GOPATH_DIR = ${GOPATH} | ||
ifeq ($(GOPATH_DIR),) | ||
GOPATH_DIR := ~/go | ||
endif | ||
.PHONY: install | ||
install: | ||
brew install node@18 | ||
brew install k6 | ||
go install go.k6.io/xk6/cmd/xk6@latest | ||
(cd $(GOPATH)/bin && ./xk6 build --with github.com/grafana/xk6-sql --with github.com/mridehalgh/xk6-sqs) | ||
|
||
.PHONY: style | ||
style: check-node-installed node-modules | ||
npm run style |
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,24 @@ | ||
# Usage | ||
|
||
For a quick start: | ||
- Follow the steps in [In-Depth Documentation](https://circlepay.atlassian.net/wiki/spaces/ENGINEERIN/pages/428179543/Load+Test+Instructions) | ||
to install K6. | ||
- Download dependencies and build the project by running: `make build`. | ||
- (todo: Instruction of starting dependency services or mock) | ||
- Start Verifier. | ||
- Run tests with `make run` command. Example: `make run TEST=dist/verification.post_challenge.test.bundle.js` | ||
|
||
| Command | Description | Environment Variables | | ||
|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `make install` | Install all dependencies to run k6 locally | N/A | | ||
| `make run` | Clean, build, and run tests locally | `TEST={PATH_TO_TEST_FILE} ENV={ENVIRONMENT}` <br/>Example: `make run ENV=dev TEST=dist/wallet_resource.create_wallet.test.bundle.js` <br/> When `ENV` is `dev`, logs will show the position of error in original source file | | ||
| `make run-dev` | Clean, build with webpack source-map, and run tests locally. Errors during runtime will point to the error location in the original source file | Same as `make run` | | ||
| `make style` | Style and fix all linting errors | N/A | | ||
| `make check-node-installed` | Check if NodeJS is installed | N/A | | ||
| `make build` | Build test source files to `dist` directory | N/A | | ||
| `make build-dev` | Build test source files to `dist` directory with webpack source-map. | N/A | | ||
| `make node-modules` | Install Node.JS npm dependencies | N/A | | ||
| `make clean` | Clean test artifacts in `dist` directory | N/A | | ||
|
||
|
||
|
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,91 @@ | ||
# Copyright 2024 Circle Internet Group, Inc. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
services: | ||
verifier_api: | ||
url: "${VERIFIER_API_URL:-http://127.0.0.1:3000}" | ||
issuer_api: | ||
url: "${ISSUER_API_URL:-https://issuer-smokebox.circle.com}" # pointing to smoke box for local development | ||
|
||
tests: | ||
verification: | ||
create: | ||
k6_options: | ||
setupTimeout: '2m' # timeout for the setup() function | ||
thresholds: | ||
http_req_failed: [ 'rate<0.01' ] # http errors should be less than 1% | ||
scenarios: | ||
scenario: | ||
executor: 'ramping-vus' # https://k6.io/docs/using-k6/scenarios/executors/ramping-vus/ | ||
startVUs: 1 | ||
stages: | ||
- duration: '1m' | ||
target: 10 | ||
- duration: '30m' | ||
target: 10 | ||
- duration: '1m' | ||
target: 1 | ||
offer: | ||
challenge_token_url_count: 20 | ||
k6_options: | ||
setupTimeout: '2m' # timeout for the setup() function | ||
thresholds: | ||
http_req_failed: [ 'rate<0.01' ] # http errors should be less than 1% | ||
scenarios: | ||
scenario: | ||
executor: 'ramping-vus' # https://k6.io/docs/using-k6/scenarios/executors/ramping-vus/ | ||
startVUs: 1 | ||
stages: | ||
- duration: '1m' | ||
target: 10 | ||
- duration: '30m' | ||
target: 10 | ||
- duration: '1m' | ||
target: 1 | ||
submit: | ||
verifiable_credential_count: 20 | ||
k6_options: | ||
setupTimeout: '2m' # timeout for the setup() function | ||
thresholds: | ||
http_req_failed: [ 'rate<0.01' ] # http errors should be less than 1% | ||
scenarios: | ||
scenario: | ||
executor: 'ramping-vus' # https://k6.io/docs/using-k6/scenarios/executors/ramping-vus/ | ||
startVUs: 1 | ||
stages: | ||
- duration: '1m' | ||
target: 10 | ||
- duration: '30m' | ||
target: 10 | ||
- duration: '1m' | ||
target: 1 | ||
end_to_end: | ||
verifiable_credential_count: 20 | ||
k6_options: | ||
setupTimeout: '2m' # timeout for the setup() function | ||
thresholds: | ||
http_req_failed: [ 'rate<0.01' ] # http errors should be less than 1% | ||
scenarios: | ||
scenario: | ||
executor: 'ramping-vus' # https://k6.io/docs/using-k6/scenarios/executors/ramping-vus/ | ||
startVUs: 1 | ||
stages: | ||
- duration: '1m' | ||
target: 10 | ||
- duration: '30m' | ||
target: 10 | ||
- duration: '1m' | ||
target: 1 |
Oops, something went wrong.