Skip to content

Commit

Permalink
Merge updates for v9.0 from OSLabs-Beta (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanycho authored Jan 25, 2023
2 parents 9dd4b20 + aceb51f commit 6fc400b
Show file tree
Hide file tree
Showing 103 changed files with 4,658 additions and 3,468 deletions.
Binary file modified .DS_Store
Binary file not shown.
33 changes: 33 additions & 0 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Jest
on:
pull_request:
types: [opened, edited, reopened, synchronize]
branches:
- dev
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.13.0"

- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: npm install

- name: Run the tests
run: npm test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ src/database/docketeerdb
yarn.lock
coverage

.history
.history
src/.DS_Store
.gitignore
src/.DS_Store
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ root
└─ src
```

4. In the .env file, configure the following environment variables for Twilio API, Slack Webhook, and Postgres URI. Refer to [Twilio](#-Twilio) setup section below. The Postgres URI is the only field that is required, others are optional.
4. In the .env file, configure the following environment variables for Twilio API, Slack Webhook, and Postgres URI. Refer to [Twilio](#-Twilio) setup section below. The Postgres URI is the only field that is required, others are optional. Create your own database to house user information and insert your URI in this file.
```js
// .env
TWILIO_NUMBER = ''
Expand Down Expand Up @@ -98,13 +98,30 @@ You are all set! Now just enter the following command to start up Docketeer!
npm run dev
```

To log in as sysadmin, use the following credentials
For now, the sign up function will create a System Admin user.


## Returning Users: Version Update
1. Navigate to the project directory and **add upstream** this [repository](https://github.com/open-source-labs/Docketeer.git) to your cloned fork.
```
username: sysadmin
password: belugas
git remote add upstream https://github.com/open-source-labs/Docketeer.git
```

2. Pull down the updates.
```
git pull origin upstream
```

3. Install new dependencies.
```
npm install
```

4. You are all set! Now just enter the following command to start up Docketeer!
```
npm run dev
```

To change the system admin password, create a new user with your preferred credentials, then change the role and role_id manually in the database.


## Twilio setup
Expand Down Expand Up @@ -136,15 +153,15 @@ You can view a list of running and exited containers, available images, volume h

### ➮ Live Metrics
Users have real-time access to the total amount of resources (CPU, memory usage) that your containers are using and total block IO bytes by image over specific time periods.
![alt text](assets/docketeer-metrics.gif)
![alt text](assets/metrics.gif)

### ➮ Uploading
Within the Image and Docker Compose tab, you pull images from DockerHub by providing `repo:version` or uploading a `.yml` file.

### ➮ Process Logs
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.

![alt text](assets/docketeer-process-logs.gif)
![alt text](assets/logs.gif)

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

Expand Down Expand Up @@ -174,6 +191,10 @@ npm run test
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.

### Authors
- Nathan Cho [@nathanycho](https://github.com/nathanycho) | [LinkedIn](https://www.linkedin.com/in/nathanycho/)
- Garima Bhatia [@GarimaB06](https://github.com/GarimaB06) | [LinkedIn](https://www.linkedin.com/in/garimab06/)
- Eshaan Joshi [@eshaan32](https://github.com/eshaan32) | [LinkedIn](https://www.linkedin.com/in/eshaanjoshi/)
- Jonathan Wong [@WongJonathann](https://github.com/WongJonathann) | [LinkedIn](https://www.linkedin.com/in/jon-wong-00/)
- Sarah Moosa [@Sbethm](https://github.com/Sbethm) | [LinkedIn](https://www.linkedin.com/in/sarah-moosa-4b05721b6/)
- Cedar Cooper [@CedarCooper](https://github.com/CedarCooper) | [LinkedIn](https://www.linkedin.com/in/cedar-cooper/)
- Tiffany Chau [@tiffanynchau](https://github.com/tiffanynchau/) | [LinkedIn](https://www.linkedin.com/in/tiffanynchau/)
Expand Down
14 changes: 6 additions & 8 deletions __tests__/ContainersTab.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Containers', () => {
test('Name of container should properly display', ()=>{
const h3 = screen.getAllByRole('heading', { level: 3 });
const name = h3[0].innerHTML;
expect(name).toEqual('Name: blissful_matsumoto');
expect(name).toEqual('blissful_matsumoto');
});

test('Stop button is called', async () => {
Expand All @@ -61,10 +61,10 @@ describe('Containers', () => {
test('Toggle Display button works', () => {
render(<ToggleDisplay {...props}/>);
const button = screen.getAllByRole('button');
expect(button[4]).toHaveTextContent('Show Details');
fireEvent.click(button[4]);
expect(button[4]).toHaveTextContent('Hide Details');

expect(button[0]).toHaveTextContent('Show Details');
fireEvent.click(button[0]);
expect(button[0]).toHaveTextContent('Hide Details');
expect(button[1]).toHaveTextContent('STOP');
});
});

Expand All @@ -78,7 +78,7 @@ describe('Containers', () => {

test('Name of container should properly display', () => {
const name = screen.getAllByText('zealous');
expect(name).toHaveLength(2);
expect(name).toHaveLength(1);
});

test('Run and remove button should fire', async () => {
Expand All @@ -89,9 +89,7 @@ describe('Containers', () => {
await fireEvent.click(removeButton);
expect(runButton).toBeCalled;
expect(removeButton).toBeCalled;

});

});
});

18 changes: 10 additions & 8 deletions __tests__/ImageTab.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import * as helper from '../src/components/helper/commands';
import { describe, beforeEach, expect, test, jest } from '@jest/globals';
import Images from '../src/components/tabs/Images';
import {
Expand Down Expand Up @@ -57,14 +58,15 @@ describe('Images', () => {
});

// currently gets stuck at window.runExec method --> reads undefined
// describe('pull button on click', () => {
// test('fires pull button functionality', () => {
// const { container } = render(<Images {...props} />);
// const pullButton = screen.getByRole('button', { name: 'Pull' });
// fireEvent.click(pullButton);
// expect(pullButton).toBeCalled;
// });
// });
describe('pull button on click', () => {
test('fires pull button functionality', () => {
// const { container } = render(<Images {...props} />);
const pullButton = screen.getByRole('button', { name: 'PULL' });
fireEvent.click(pullButton);
expect(pullButton).toBeCalled;
expect(Images.handleClick).toBeCalled;
});
});

describe('Images', () => {
test('Renders an image if one is found', () => {
Expand Down
Loading

0 comments on commit 6fc400b

Please sign in to comment.