Skip to content

[PROD] TaaS Release 1.0 #611

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

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
76c64a5
Add the performance testing code
codejamtc Dec 22, 2020
accc73a
Update README.md
codejamtc Dec 22, 2020
c05fc86
Update config.yml
codejamtc Dec 22, 2020
ff43cb4
Update config.yml
codejamtc Dec 23, 2020
ca831c0
Merge pull request #606 from topcoder-platform/hotfix/milestone-delete
RishiRajSahu Dec 29, 2020
7d71274
Update config.yml
codejamtc Jan 6, 2021
a8567db
Merge branch 'develop' into connect-performance-testing
codejamtc Jan 6, 2021
3009b3d
Update config.yml
codejamtc Jan 6, 2021
a30c703
Update JMeter_README.md
codejamtc Jan 6, 2021
ac6312d
Update config.yml
codejamtc Jan 6, 2021
bf6f03d
Revert "chore: temporary disable jobs creation"
maxceem Jan 6, 2021
8a3544a
feat: updated TaaS Job creation data
maxceem Jan 7, 2021
f94ae6a
fix: creating taas jobs
maxceem Jan 7, 2021
4ff4dac
fix: rename field of TaaS Jobs
maxceem Jan 7, 2021
6b8813c
Merge pull request #603 from topcoder-platform/connect-performance-te…
RishiRajSahu Jan 8, 2021
f6177a1
fix: use "weekly" rateType for create jobs
maxceem Jan 11, 2021
b2f1a43
feat: don't set unknown fields for Jobs
maxceem Jan 12, 2021
2581421
Add unit test to the circleci conf file
codejamtc Jan 12, 2021
c0599ab
Update config.yml
codejamtc Jan 12, 2021
743ef07
Update config.yml
codejamtc Jan 12, 2021
41c04d3
Update config.yml
codejamtc Jan 12, 2021
cbbc13f
Update config.yml
codejamtc Jan 12, 2021
2d2ab63
fix: lint
maxceem Jan 12, 2021
e66d88d
Merge branch 'develop' into connect-performance-testing
codejamtc Jan 12, 2021
8c062b8
Update config.yml
codejamtc Jan 12, 2021
a2ffa2c
Merge pull request #612 from topcoder-platform/connect-performance-te…
maxceem Jan 12, 2021
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
60 changes: 53 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ deploy_steps: &deploy_steps
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}

jobs:
test:
UnitTests:
docker:
- image: circleci/node:12.16.1
- image: circleci/postgres:9.6.2-alpine
Expand Down Expand Up @@ -102,23 +102,69 @@ jobs:
APPNAME: "projects-api"
steps: *deploy_steps

Connect-Performance-Testing:
docker:
# specify the version you desire here
- image: circleci/openjdk:8-jdk

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

working_directory: ~/repo

environment:
# Customize the JVM maximum heap limit
MAVEN_OPTS: -Xmx3200m

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: mvn dependency:go-offline

- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}

- run: mvn verify

- store_artifacts:
path: target/jmeter/reports

workflows:
version: 2
build:
Connect Project Services:
jobs:
- test:
- UnitTests:
context : org-global
- deployDev:
context : org-global
requires:
- test
- UnitTests
filters:
branches:
only: ['develop']
only: ['develop', 'connect-performance-testing']
- deployProd:
context : org-global
requires:
- test
- UnitTests
filters:
branches:
only: ['master']
only: ['master']
- Hold [Performance-Testing]:
type: approval
requires:
- deployDev
- deployProd
- Connect-Performance-Testing:
requires:
- Hold [Performance-Testing]
153 changes: 153 additions & 0 deletions JMeter_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Performance Testing for Topcoder Connect App

## Description

Topcoder Connect is a web application that makes it easy to tap into the power of crowdsourcing to get more work done faster. Connect is ideal for projects that include application design and/or development work. You can crowdsource the entire application development lifecycle or just the specific stages where you need help. Common deliverables include application wireframes, UI/UX designs, prototypes, MVPs, and production-ready apps for any kind of device—mobile, wearables, or the web.

## Dependencies

- Jmeter maven plugin 2.9.0
- Maven 3.5.2
- JDK between 8 and 11

## Prerequisite

- We have already included the workflow into the circleci conf file with the usual dev builds.

## Directory Structure

- .circleci (Circleci configuration file)
- \src\test\jmeter - Includes the JMX file(s) and CSV data files
- pom file

### **Setup and Runtime**

Add the plugin to your project: Add the plugin to the build section of your pom's project

```
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<!-- Generate JMeter configuration -->
<execution>
<id>configuration</id>
<goals>
<goal>configure</goal>
</goals>
</execution>
<!-- Run JMeter tests -->
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<!-- Fail build on errors in test -->
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
</plugin>
```

This simple load test is already integrated with the current build process

```
workflows:
version: 2
Connect Project Services:
jobs:
- build:
context : org-global
- deployDev:
context : org-global
requires:
- build
filters:
branches:
only: ['develop']
- deployProd:
context : org-global
requires:
- build
filters:
branches:
only: ['master']
- Hold [Performance-Testing]:
type: approval
requires:
- build
- deployDev
- deployProd
- Connect-Performance-Testing:
requires:
- Hold [Performance-Testing]
```

- Hold [Performance-Testing] - This is the approval job we needs manual interaction.
- It requires `build`, `deployDev` and `deployProd` jobs to run first.
- Actual performance testing job is `Connect-Performance-Testing` and it requires `Hold [Performance-Testing]` job to finish.

### **Configuration**

<img src="https://imgur.com/0WNB89y.png" alt="">
<img src="https://imgur.com/rdP3t77.png" alt="">

This performance test is for 15 virtual users. The parameters for this test plan is as below;

- Start Thread Count
- Initial Deplay, sec (Startup Time + Hold Load For)
- Startup Time, sec (Start Thread Count = Startup Time)
- Hold Load For, sec
- Shutdown Time (Next row `Initial Deplay`)

**Formulas:**

```
Initial time of a record = initialtime + start up time/ramp-up time + holdtime of the previous record
```

```
start up time/ramp-up time = Shutdown time/ramp-down time of the previous record
```

This setup is configured to run 6min with 15 UVs.

**Token Details**

- `audience` - https://m2m.topcoder-dev.com/
- `grant_type` - client_credentials
- `content-type` - application/json
- `client_id` - jGIf2pd3f44B1jqvOai30BIKTZanYBfU
- `client_secret` - ldzqVaVEbqhwjM5KtZ79sG8djZpAVK8Z7qieVcC3vRjI4NirgcinKSBpPwk6mYYP

To extract the token we are using the variable `access_token`

TO pass the `access_token` varaible globally we are using the beanshell Assertion

`${__setProperty(access_token, ${access_token})};`

**Random Controller**

We are using Random Controller to randomize the requests sent to the server to simulate the different request.

**Think Time**

We are using this parameter to implement a random wait time in betweent the request to simulate the real user experience.

**HTTP Requets**

- Access Tabs - Simulate user accessing different tabs
- Access Projects - Simulate user accessing different projetcs
- Assets Library (Link Insert) - Add Links to the projects

## Check the reports and data

After running the job using the circleci user can view the report by clicking on the Job: `Connect-Performance-Testing` > Artifacts > `target/jmeter/reports/15UV Ultimate Thread-Group/index.html`

eg: https://2728-60865675-gh.circle-artifacts.com/0/target/jmeter/reports/15UV%20Ultimate%20Thread-Group/index.html
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJhZG1pbmlzdHJhdG9yIl0sImlzcyI
```
It's been signed with the secret 'secret'. This secret should match your entry in config/local.js. You can generate your own token using https://jwt.io

## Performance Testing

- [Performance Testing Readme](README.md)

## Documentation

- [Projects Service Architecture](./docs/guides/architercture/architecture.md)
Expand Down
Loading