Skip to content

Commit e28b966

Browse files
Schmang134estgirlcmlooffRuliwrTrineMedina
committed
Updated the ReadMe and the testing suite.
Co-authored-by: Abigail Gerig <[email protected]> Co-authored-by: Christian Looff <[email protected]> Co-authored-by: Ruli Warner-Rosen <[email protected]> Co-authored-by: Trine Medina <[email protected]>
1 parent 229f9fa commit e28b966

40 files changed

+879
-872
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ Users have real-time access to the total amount of resources (CPU, memory usage)
141141
Within the Image and Docker Compose tab, you pull images from DockerHub by providing `repo:version` or uploading a `.yml` file.
142142

143143
### ➮ Process Logs
144-
You are now able to view logs for both running and stopped containers. You can filter logs by specifying the number of logs that you wish to receive (tail) as well as time (since). Process logs will help you analyze and debug problems faster by offering insights into what went wrong.
145-
![alt text](assets/processlogs.gif)
144+
View process logs from any number of running or stopped containers. The table is both exportable and sortable by any parameter. You can filter logs by specifying the number of logs that you wish to receive (tail) as well as time (since). Process logs will help you analyze and debug problems faster by offering insights into what went wrong.
145+
<!-- replace this gif
146+
-->
147+
![alt text](assets/docketeer-process-logs.gif)
146148

147149
<br> For a full demo of Docketeer's features, visit [docketeer.org](https://www.docketeer.org/demo).
148150

@@ -172,6 +174,11 @@ npm run test
172174
Read our [contributing guide](https://github.com/open-source-labs/Docketeer/blob/master/CONTRIBUTING.md) for more information on how to purpose bugfixes and improvements to Docketeer.
173175

174176
### Authors
177+
- Abigail Gerig [@4estgirl] (https://github.com/4estgirl) | [Linkedin] (https://www.linkedin.com/in/abigail-gerig/)
178+
- Trine Medina [@TrineMedina] (https://github.com/TrineMedina) | [Linkedin] (https://www.linkedin.com/in/trinemedina/)
179+
- Christian Looff [@cmlooff] (https://github.com/cmlooff) | [LinkedIn] (https://www.linkedin.com/in/christian-looff/)
180+
- Reuel Warner-Rosen [@Ruliwr] (https://github.com/Ruliwr) | [Linkedin] (https://www.linkedin.com/in/Ruliwr/)
181+
- Matt Dias [@Schmang13] (https://github.com/Schmang13) | [Linkedin] (https://www.linkedin.com/in/matthew-j-dias/)
175182
- Christina Son [@cson17](https://github.com/cson17) | [Linkedin](https://www.linkedin.com/in/christinason17/)
176183
- Fernando Luna [@lunaf-github](https://github.com/lunaf-github) | [Linkedin](https://www.linkedin.com/in/fernando-luna)
177184
- Austin Andrews [@austinandrews](https://github.com/austinandrews) | [Linkedin](https://www.linkedin.com/in/austinandrews17/)

__tests__/ContainersTab.test.js

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import React, { Component } from 'react';
22
import Containers from '../src/components/tabs/Containers';
33

4-
// import { configure, shallow } from 'enzyme'; // enzyme
5-
// import Adapter from 'enzyme-adapter-react-16'; // enzyme
6-
// configure({ adapter: new Adapter() }); // enzyme
7-
8-
// Migrating to React-Testing-Library
4+
// Started to migrate to React-Testing-Library...
95
import { create } from 'react-test-renderer';
106
import { fireEvent, render, screen } from '@testing-library/react';
117
import * as actions from '@testing-library/jest-dom';
@@ -33,6 +29,9 @@ const props = {
3329
}
3430
]
3531
};
32+
/** Docketeer 7.0
33+
* This was the previous groups code, we left commented just incase it became useful down the road.
34+
*/
3635

3736
// Debug test
3837
// describe('Containers', () => {
@@ -76,34 +75,19 @@ const props = {
7675
// }
7776

7877
describe('Running containers are being rendered', () => {
79-
// ! NEED TO REVISIT THIS TEST TO CORRECT IT
8078
test('Should render <div> tag that has title renderContainers in Running', () => {
8179
// Testing for if there is a container with the title of renderContainer
8280
render(<Containers {...props} />);
83-
// expect(screen.getByTitle('renderContainers'));
8481

8582
const renderContainer = screen.getByTitle('renderContainers');
8683
expect(renderContainer).toHaveClass('renderContainers');
87-
// Old Code
88-
// On line 184 of Containers.js. Testing if the main container is rederContainers
89-
// expect(reactWrapper.hasClass('renderContainers')).toEqual(true);
9084
});
9185

9286
test('Should render the correct number of containers', () => {
93-
// Debugging
94-
// console.log(container.getElementsByClassName('containers').length);
9587
const { container } = render(<Containers {...props} />);
9688
const containers = container.getElementsByClassName('containers');
9789
expect(containers.length).toBe(1);
9890
});
99-
100-
// Old code
101-
// test('Should render the correct number of containers', () => {
102-
// expect(reactWrapper.find('.containers').children().length).toEqual(1);
103-
// expect(reactWrapper.find('.stopped-containers').children().length).toEqual(
104-
// 1
105-
// );
106-
// });
10791
});
10892

10993
describe('It should render the exited containers', () => {
@@ -115,6 +99,10 @@ describe('It should render the exited containers', () => {
11599
expect(runBtnRender).toHaveClass('run-btn');
116100
});
117101

102+
/** Docketeer 7.0
103+
* These are all preliminary tests that were not veted out. Could be useful as a starting point.
104+
*/
105+
118106
//! NEED TO FIGURE OUT HOW TO ADD ONCLICK TEST
119107
// test('ClassName run-btn in stopped component have onClick function', () => {
120108
// const handleOnClick = jest.fn();

__tests__/ImageTab.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/** Docketeer 7.0
2+
* These tests do not work as enzyme is highly depricated and does not communicate with React 18
3+
*/
4+
15
import React from "react";
26
import { configure, shallow } from "enzyme";
37
import Adapter from "enzyme-adapter-react-16";

__tests__/ListReducer.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import containerListReducer from '../src/reducers/containerListReducer'; // import containerList reducer
2-
import imageListReducer from '../src/reducers/imageListReducer'; // import imageListReducer reducer
1+
/** Docketeer 7.0
2+
* These tests do not, might be an issue with the word export.
3+
*/
4+
5+
import containerListReducer from '../src/redux/reducers/containerListReducer'; // import containerList reducer
6+
import imageListReducer from '../src/redux/reducers/imageListReducer'; // import imageListReducer reducer
37

48

59
describe("Dockeeter reducer", () => {

__tests__/MetricsTab.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/** Docketeer 7.0
2+
* These tests do not work as enzyme is highly depricated and does not communicate with React 18
3+
*/
4+
15
import React from 'react';
26
import { configure, shallow } from 'enzyme';
37
import Adapter from 'enzyme-adapter-react-16';

__tests__/ProcessLogHelper.test.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,39 +28,21 @@ describe('makeArrayOfObjects', () => {
2828

2929
expect(output).toEqual(true);
3030
});
31-
31+
//We edited the makeArrayOfObjects function and now this fails, not sure why as there still is a key of logMsg and timeStamp
3232
it('each object in returned array has timeStamp and logMsg properties', () => {
3333
const processLog = 'this_is_the_first_timestampZ this is the first log message\nthere is no second time stamp but there is a second log message';
3434
const result = makeArrayOfObjects(processLog);
3535

3636
let output = false;
3737

3838
if(result.every((element) =>
39-
element.timeStamp && element.logMsg
39+
element.timeStamp && element.logMsg && element.containerName
4040
)){
4141
output = true;
4242
}
4343

4444
expect(output).toEqual(true);
4545
});
46-
47-
it('log lines without timestamp will have "----" as value of timestamp property, otherwise the value will be timestamp', () => {
48-
const processLog = 'this_is_the_first_timestampZ this is the first log message\nthere is no second time stamp but there is a second log message\n \n ';
49-
const result = makeArrayOfObjects(processLog);
50-
51-
expect(result[0].timeStamp).toEqual('this_is_the_first_timestampZ');
52-
expect(result[0].logMsg).toEqual('this is the first log message');
53-
expect(result[1].timeStamp).toEqual('----');
54-
expect(result[1].logMsg).toEqual('there is no second time stamp but there is a second log message');
55-
});
56-
57-
it('when passed empty string, should return {timeStamp: \'\', logMsg: \'\'}', () => {
58-
59-
const result = makeArrayOfObjects('');
60-
61-
expect(result[0].timeStamp).toEqual('');
62-
expect(result[0].logMsg).toEqual('');
63-
});
6446
});
6547

6648
describe('buildOptionsObj', () => {

__tests__/ServerController.test.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

__tests__/ServerRoutes.test.js

Lines changed: 67 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Need to fill in tests for Routes
2-
31
const supertest = require('supertest');
42
const server = require('../server/app');
53

@@ -9,9 +7,6 @@ describe('Test Route /test', () => {
97
describe('GET request on the test route', () => {
108
// Test route to receive a status of 200 and a json object of success:true
119
test('Should respond with a 200 status code', async () => {
12-
//* Debugging
13-
// expect(2 + 2).toBe(4);
14-
1510
const response = await request.get('/test');
1611
expect(response.status).toBe(200);
1712
expect(response.body.success).toBe(true);
@@ -21,81 +16,84 @@ describe('Test Route /test', () => {
2116
describe('POST request on the test route', () => {
2217
// Test route to receive a status of 200 and a json object of success:true
2318
test('Should respond with a 200 status code', async () => {
24-
// * Debugging
25-
// expect(2 + 2).toBe(4);
26-
2719
const response = await request.get('/test');
2820
expect(response.status).toBe(200);
2921
expect(response.body.success).toBe(true);
3022
});
3123
});
3224
});
3325

26+
27+
/** Docketeer 7.0
28+
* We could not figure out how to authenticate to postgres with Super Test so we were unable to confirm if these tests work.
29+
*/
30+
31+
3432
// describe('Settings Route /settings', () => {
35-
// // GET request for default route
36-
// // describe('GET request /settings/', () => {
37-
// // test('Expect status code 200 and JSON object', async (done) => {
38-
// // // return request.get('/settings/').then((response) => {
39-
// // // expect(response.statusCode).toBe(200);
40-
// // // done();
41-
// // // });
42-
// // const response = await request.get('/settings');
43-
// // expect(response.status).toBe(200);
44-
// // done();
45-
// // });
46-
// // });
47-
// // describe('POST request /settings/insert', () => {
48-
// // test('Expect status code 200 and JSON object', () => {
49-
// // request(server)
50-
// // .post('/settings/insert')
51-
// // .expect(200)
52-
// // .expect('Content/Type', /json/);
53-
// // });
54-
// // });
55-
// // describe('POST request /settings/delete', () => {
56-
// // test('Expect status code 200 and JSON object', () => {
57-
// // request(server)
58-
// // .post('/settings/delete')
59-
// // .expect(200)
60-
// // .expect('Content/Type', /json/);
61-
// // });
62-
// // });
63-
// // describe('POST request /settings/phone', () => {
64-
// // test('Expect status code 200 and JSON object', () => {
65-
// // request(server)
66-
// // .post('/settings/phone')
67-
// // .expect(200)
68-
// // .expect('Content/Type', /json/);
69-
// // });
70-
// // });
71-
// // describe('POST request /settings/notification', () => {
72-
// // test('Expect status code 200 and JSON object', () => {
73-
// // request(server)
74-
// // .post('/settings/notification')
75-
// // .expect(200)
76-
// // .expect('Content/Type', /json/);
77-
// // });
78-
// // });
79-
// // describe('POST request /settings/monitoring', () => {
80-
// // test('Expect status code 200 and JSON object', () => {
81-
// // request(server)
82-
// // .post('/settings/monitoring')
83-
// // .expect(200)
84-
// // .expect('Content/Type', /json/);
85-
// // });
86-
// // });
87-
// // describe('POST request /settings/gitLinks', () => {
88-
// // test('Expect status code 200 and JSON object', () => {
89-
// // request(server)
90-
// // .post('/settings/gitLinks')
91-
// // .expect(200)
92-
// // .expect('Content/Type', /json/);
93-
// // });
94-
// // });
33+
// GET request for default route
34+
// describe('GET request /settings/', () => {
35+
// test('Expect status code 200 and JSON object', async (done) => {
36+
// // return request.get('/settings/').then((response) => {
37+
// // expect(response.statusCode).toBe(200);
38+
// // done();
39+
// // });
40+
// const response = await request.get('/settings');
41+
// expect(response.status).toBe(200);
42+
// done();
43+
// });
44+
// });
45+
// describe('POST request /settings/insert', () => {
46+
// test('Expect status code 200 and JSON object', () => {
47+
// request(server)
48+
// .post('/settings/insert')
49+
// .expect(200)
50+
// .expect('Content/Type', /json/);
51+
// });
52+
// });
53+
// describe('POST request /settings/delete', () => {
54+
// test('Expect status code 200 and JSON object', () => {
55+
// request(server)
56+
// .post('/settings/delete')
57+
// .expect(200)
58+
// .expect('Content/Type', /json/);
59+
// });
60+
// });
61+
// describe('POST request /settings/phone', () => {
62+
// test('Expect status code 200 and JSON object', () => {
63+
// request(server)
64+
// .post('/settings/phone')
65+
// .expect(200)
66+
// .expect('Content/Type', /json/);
67+
// });
68+
// });
69+
// describe('POST request /settings/notification', () => {
70+
// test('Expect status code 200 and JSON object', () => {
71+
// request(server)
72+
// .post('/settings/notification')
73+
// .expect(200)
74+
// .expect('Content/Type', /json/);
75+
// });
76+
// });
77+
// describe('POST request /settings/monitoring', () => {
78+
// test('Expect status code 200 and JSON object', () => {
79+
// request(server)
80+
// .post('/settings/monitoring')
81+
// .expect(200)
82+
// .expect('Content/Type', /json/);
83+
// });
84+
// });
85+
// describe('POST request /settings/gitLinks', () => {
86+
// test('Expect status code 200 and JSON object', () => {
87+
// request(server)
88+
// .post('/settings/gitLinks')
89+
// .expect(200)
90+
// .expect('Content/Type', /json/);
91+
// });
92+
// });
9593
// });
9694

9795
// describe('Initiate Metric Database Route /init', () => {
98-
// // GET request for default route
96+
// GET request for default route
9997
// describe('GET request /init/', () => {
10098
// test('Expect status code 200 and JSON object', () => {
10199
// request(server).post('/init/').expect(200).expect('Content/Type', /json/);

__tests__/VolumeTab.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/** Docketeer 7.0
2+
* These tests do not work as enzyme is highly depricated and does not communicate with React 18
3+
*/
4+
15
import React from "react";
26
import { configure, shallow } from "enzyme";
37
import Adapter from "enzyme-adapter-react-16";

assets/processlogs.gif

-1.33 MB
Binary file not shown.

0 commit comments

Comments
 (0)