Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CC-34875: Phase 2 of Performance test infrastructure #28

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
45 changes: 45 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'prettier',
],
globals: {
__ENV: 'readonly',
__ITER: 'readonly',
__VU: 'readonly',
},
ignorePatterns: ['node_modules/*', 'screenshots/*', 'lib/external/*'],
rules: {
'prettier/prettier': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'no-mixed-spaces-and-tabs': 'error',
'no-multi-spaces': 'error',
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
'function-paren-newline': ['error', 'multiline'],
'max-len': [
'error',
{
code: 120,
tabWidth: 2,
ignoreUrls: true,
ignoreTemplateLiterals: true,
ignoreStrings: true,
ignoreRegExpLiterals: true,
},
],
},
};
32 changes: 0 additions & 32 deletions .eslintrc.js

This file was deleted.

5 changes: 4 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
## PR Description

Add a meaningful description here that will let us know what you want to fix with this PR or what functionality you want to add.

## Steps before you submit a PR

- Please add tests for the code you add if it's possible.
- Please check out our contribution guide: https://docs.spryker.com/docs/dg/dev/code-contribution-guide.html
- Add a `contribution-license-agreement.txt` file with the following content:
`I hereby agree to Spryker\'s Contribution License Agreement in https://github.com/spryker/commerce-k6-performance-tests/blob/HASH_OF_COMMIT_YOU_ARE_BASING_YOUR_BRANCH_FROM_MASTER_BRANCH/CONTRIBUTING.md.`
`I hereby agree to Spryker\'s Contribution License Agreement in https://github.com/spryker/commerce-k6-performance-tests/blob/HASH_OF_COMMIT_YOU_ARE_BASING_YOUR_BRANCH_FROM_MASTER_BRANCH/CONTRIBUTING.md.`

This is a mandatory step to make sure you are aware of the license agreement and agree to it. `HASH_OF_COMMIT_YOU_ARE_BASING_YOUR_BRANCH_FROM_MASTER_BRANCH` is a hash of the commit you are basing your branch from the master branch. You can take it from commits list of master branch before you submit a PR.

## Checklist

- [x] I agree with the Code Contribution License Agreement in CONTRIBUTING.md
42 changes: 23 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
name: CI

on:
pull_request:
push:
branches:
- main
# This workflow is triggered on pushes and pull requests to the repository.
on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- run: npx eslint ./
code-quality-check:
name: Check Code Quality (Prettier & ESLint)
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Check Prettier Formatting
run: npm run prettier:check

- name: Run ESLint
run: npx eslint ./
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.idea/
settings.json
result.html
/node_modules/
/.env
/results/
!/results/.gitkeep
!/results/summaries/.gitkeep
.lh
.lh
dist
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "auto"
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM grafana/k6:0.47.0-with-browser
FROM grafana/k6:0.56.0-with-browser

ENV TERM=xterm-256color
ENV PROJECT_DIR=/home/k6
Expand Down
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
# Spryker Performance Testing Framework

## Run locally

Enable influxdb and grafana services:

```bash
docker-compose -f docker-compose.suite.local.yml up -d influxdb grafana
```

Run single test:

```bash
./shell/run-a-single-test-locally.sh tests/suite/sapi/tests/cart-reorder/SUITE-SAPI15-cart-reorder_50.js
```

## Description

This repository contains the test scenarios and helpers that are used to perform different kinds of tests using [K6](https://k6.io/) for Sprykers products. It also provides the infrastructure to run tests against multiple products and share tests that are the same in each product.

## Test Suite Documentation

* [Executing Tests](docs/Executing-Tests.md)
* [Testing different Environments](docs/Testing-different-Environments.md)
* [Testing Local Environments](docs/Testing-Local-Environments.md)
* [Uploading Test Result Artifacts to S3](docs/Uploading-Results-to-S3.md)
* [ESLint](docs/Eslint.md)
* [Possible Problems and Solutions](docs/Possible-Problems-and-Solutions.md)
- [Executing Tests](docs/Executing-Tests.md)
- [Testing different Environments](docs/Testing-different-Environments.md)
- [Testing Local Environments](docs/Testing-Local-Environments.md)
- [Uploading Test Result Artifacts to S3](docs/Uploading-Results-to-S3.md)
- [ESLint](docs/Eslint.md)
- [Possible Problems and Solutions](docs/Possible-Problems-and-Solutions.md)

## Official K6 Documentation

* [Official K6 documentation](https://k6.io/docs/)
* [Setting up K6](https://k6.io/docs/get-started/installation/)
- [Official K6 documentation](https://k6.io/docs/)
- [Setting up K6](https://k6.io/docs/get-started/installation/)
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"type": "library",
"license": "MIT",
"require": {}
}
}
Loading
Loading