Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f277f64
add naivecoin cs
man-zhang Mar 28, 2021
f9b86f7
add nestjs-realworld-example-app
man-zhang Mar 28, 2021
26499df
update ignore
man-zhang Mar 29, 2021
69dcf25
initial versions of openapi (version 3.0) for spaceX
man-zhang Mar 30, 2021
d10b708
add original version of spaceX
man-zhang Mar 30, 2021
d34e96f
add driver for spaceX
man-zhang Mar 30, 2021
14fe6e8
update README.md for new js case studies
man-zhang Mar 30, 2021
20a14fd
enable spaceX with test container and dbcleaner
man-zhang Mar 30, 2021
a8e333f
initAuth into db and setup auth info in driver
man-zhang Mar 30, 2021
56fd833
remove auth in driver
man-zhang Mar 30, 2021
ad3228e
setup authInfo
man-zhang Mar 30, 2021
b97f5f2
add get free port, and this might be part of em-controller
man-zhang Apr 1, 2021
f8154cb
update ignore
man-zhang Jul 20, 2021
4e7e3b5
update spaceX app driver.js
man-zhang Jul 22, 2021
a923910
update app driver and db-handler
man-zhang Jul 22, 2021
7f9ebc0
fix resetSut for naivecoin case study
man-zhang Aug 9, 2021
d375b19
add db cleaner for mysql
man-zhang Aug 18, 2021
be36e5c
update http schema for js suts
man-zhang Aug 23, 2021
e610b27
add js sut in dist
man-zhang Aug 23, 2021
dbbaf7a
Merge branch 'master' into naivecoin-js
man-zhang Aug 23, 2021
88e13ca
update jest configuration
man-zhang Aug 24, 2021
4f42312
skip an endpoint for spaceX
man-zhang Aug 25, 2021
62e3b33
call TSC from build
arcuri82 Aug 26, 2021
0731fa4
clean jest config and modify the db handler for disease-sh-api
man-zhang Aug 31, 2021
f8b8f85
re-enable skipped endpoint for spaceX
man-zhang Aug 31, 2021
ce4bb37
remove env var setting for js 'em'
man-zhang Sep 1, 2021
efb746c
configure if employ a docker
man-zhang Sep 1, 2021
e86ee29
config if employ test container
man-zhang Sep 4, 2021
36adcb8
bb with coverage
man-zhang Sep 6, 2021
75fced3
TB and EM_TB
man-zhang Sep 7, 2021
613b113
remove naivecoin
man-zhang Jan 25, 2022
a85f55c
Merge branch 'master' into naivecoin-js
man-zhang Jan 25, 2022
3e1aef1
update app due to updated RPCProblem dto
man-zhang Jan 25, 2022
dfc453f
clean the code
man-zhang Jan 25, 2022
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
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ hs_err_pid*
/jdk_11_gradle/em/external/graphql/patio-api/build


/jdk_8_maven/em/external/rest/restcountries/target/
/jdk_8_maven/em/embedded/rest/restcountries/target/

### JavaScript
/venv/
Expand All @@ -172,7 +174,12 @@ hs_err_pid*
/js_npm/rest/disease-sh-api/build/
/js_npm/rest/disease-sh-api/EvoMasterTest.js
/js_npm/rest/disease-sh-api/redis/

/js_npm/rest/nestjs-realworld-example-app/node_modules/
/js_npm/rest/nestjs-realworld-example-app/build/
/js_npm/rest/naivecoin/build/
/js_npm/rest/naivecoin/node_modules/
/js_npm/rest/spaceX/node_modules/
/js_npm/rest/spaceX/build/


#DotNet
Expand All @@ -185,3 +192,6 @@ dotnet_3/em/embedded/rest/SampleProjectDriver/logs/
.vs/
*.launchSettings.json
*.sln.DotSettings.user



4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ projects, each one with its own license, as clarified in more details beneath.

* SCS (not-known license, artificial string examples coming from different sources)

* SpaceX-API (Apache-2.0 License), from [https://github.com/r-spacex/SpaceX-API](https://github.com/r-spacex/SpaceX-API)

* nestjs-realworld-example-app (ISC), from [https://github.com/lujakob/nestjs-realworld-example-app](https://github.com/lujakob/nestjs-realworld-example-app)

### REST: .Net/C#

* Menu.API (not-known license), from [https://github.com/chayxana/Restaurant-App](https://github.com/chayxana/Restaurant-App)
Expand Down
3 changes: 1 addition & 2 deletions js_npm/rest/cyclotron/em/app-driver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const dbHandler = require("./db-handler");


const http = require("http");
const {AddressInfo} = require("net");
const mongoose = require('mongoose');
Expand All @@ -27,7 +26,7 @@ class AppController extends em.SutController {

getProblemInfo() {
const dto = new em.dto.RestProblemDto();
dto.swaggerJsonUrl = "http://localhost:" + this.port + "/swagger.json";
dto.openApiUrl = "http://localhost:" + this.port + "/swagger.json";

return dto;
}
Expand Down
26 changes: 0 additions & 26 deletions js_npm/rest/cyclotron/em/driver-Test.js

This file was deleted.

110 changes: 0 additions & 110 deletions js_npm/rest/cyclotron/em/sample-Test.js

This file was deleted.

7 changes: 6 additions & 1 deletion js_npm/rest/cyclotron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,15 @@
},
"jest": {
"testEnvironment": "node",
"testRegex": "(em|tests|bbtests)/.*Test\\.(js|jsx|ts|tsx)$",
"testRegex": "em/.*Test\\.(js|jsx|ts|tsx)$",
"collectCoverageFrom": [
"src/**/*.(js|jsx|ts|tsx)"
],
"coverageReporters": [
"json",
"html",
"json-summary"
],
"transformIgnorePatterns": [
"<rootDir>/node_modules/",
"<rootDir>/bbtests/",
Expand Down
13 changes: 7 additions & 6 deletions js_npm/rest/disease-sh-api/em/app-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {AddressInfo} = require("net");
const em = require("evomaster-client-js");


class AppController extends em.SutController {
class AppController extends em.SutController {


setupForGeneratedTest(){
Expand All @@ -27,7 +27,7 @@ class AppController extends em.SutController {

getProblemInfo() {
const dto = new em.dto.RestProblemDto();
dto.swaggerJsonUrl = "http://localhost:" + this.port + "/apidocs/swagger_v3.json";
dto.openApiUrl = "http://localhost:" + this.port + "/apidocs/swagger_v3.json";

return dto;
}
Expand All @@ -54,10 +54,11 @@ class AppController extends em.SutController {
}

stopSut() {
return new Promise( (resolve) =>
{
this.server.close( () => resolve());
}
return new Promise( (resolve) => {
this.server.close( () => {
dbHandler.stopDb();
resolve();
});}
);
}

Expand Down
27 changes: 16 additions & 11 deletions js_npm/rest/disease-sh-api/em/db-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@ let test_container = null;

module.exports ={
startDb: async () =>{
console.log("start db")
dbPort = process.env.DB_PORT || 50000;

const environment = await new DockerComposeEnvironment(__dirname, "test-redis-db.yml")
.withWaitStrategy("redis_1", Wait.forLogMessage("Ready to accept connections"))
.up();
test_container = await environment.getContainer("redis_1");
exposedDbPort = test_container.getMappedPort(dbPort);
process.env.REDIS_PORT = exposedDbPort;

console.log("connecting redis-server with "+exposedDbPort);
if(process.env.DOCKER_DBC && process.env.DOCKER_DBC === '0'){
console.log("use local redis on port:" + process.env.REDIS_PORT)
}else{
console.log("start docker db")
dbPort = process.env.DB_PORT || 50000;

// solve ioredis connection problem https://github.com/luin/ioredis/issues/763
const environment = await new DockerComposeEnvironment(__dirname, "test-redis-db.yml")
.withWaitStrategy("redis_1", Wait.forLogMessage("Ready to accept connections"))
.up();
test_container = await environment.getContainer("redis_1");
exposedDbPort = test_container.getMappedPort(dbPort);
process.env.REDIS_PORT = exposedDbPort;

console.log("connecting redis-server with " + exposedDbPort+ " " + test_container.getHost());
}
return test_container;
},

Expand Down
37 changes: 0 additions & 37 deletions js_npm/rest/disease-sh-api/em/sample-Test.js

This file was deleted.

3 changes: 2 additions & 1 deletion js_npm/rest/disease-sh-api/em/test-redis-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ version: "3.8"

services:
redis:
image: redis:latest
image: redis:6.2.5
command: ["redis-server", "--bind", "redis", "--port", "50000"]
ports:
- 50000
volumes:
Expand Down
11 changes: 8 additions & 3 deletions js_npm/rest/disease-sh-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build": "babel em src -d build/src --copy-files",
"em": "node build/src/em-main.js",
"updateCheck": "node src/updateCheck.js",
"start": "node src/serverStart.js",
"start": "node src/serverStart.js",
"start:scraper": "node --insecure-http-parser src/serverScraper.js",
"start:devserver": "nodemon --watch routes --watch scrapers --watch utils ./src/serverStart.js",
"start:dev": "concurrently --kill-others-on-fail --kill-others \"npm:start:devserver\" \"npm:start:scraper\"",
Expand Down Expand Up @@ -57,7 +57,7 @@
"dedent": "0.7.0",
"superagent": "5.2.2",
"supertest": "4.0.2",
"testcontainers": "^6.3.0"
"testcontainers": "7.20.0"
},
"babel": {
"only": [
Expand All @@ -68,10 +68,15 @@
]
},
"jest": {
"testRegex": "(em|tests)/.*Test\\.(js|jsx|ts|tsx)$",
"testRegex": "em/.*Test\\.(js|jsx|ts|tsx)$",
"collectCoverageFrom": [
"src/**/*.(js|jsx|ts|tsx)"
],
"coverageReporters": [
"json",
"html",
"json-summary"
],
"transformIgnorePatterns": [
"<rootDir>/node_modules/",
"<rootDir>/tests/",
Expand Down
2 changes: 1 addition & 1 deletion js_npm/rest/ncs/em/app-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AppController extends em.SutController {

getProblemInfo() {
const dto = new em.dto.RestProblemDto();
dto.swaggerJsonUrl = "http://localhost:" + this.port + "/swagger.json";
dto.openApiUrl = "http://localhost:" + this.port + "/swagger.json";

return dto;
}
Expand Down
Loading