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

Unit tests #591

Merged
merged 50 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
03a7d8a
Setup basic unit tests for utilities
OmkarPh Jul 17, 2023
f5bf73a
Merge remote-tracking branch 'origin/v4.0-react-typescript' into feat…
OmkarPh Jul 17, 2023
bfc2a73
Completed tests for utils
OmkarPh Jul 22, 2023
6058858
Completed tests for verifying header imports
OmkarPh Jul 28, 2023
3add0f1
Merge remote-tracking branch 'origin/v4.0-react-typescript' into feat…
OmkarPh Jul 28, 2023
cf8ffcd
Merge remote-tracking branch 'origin/v4.0-react-typescript' into feat…
OmkarPh Jul 31, 2023
3729ae9
Refactor parser, Added tests for Copyright & headers
OmkarPh Aug 2, 2023
76e1a85
Added tests for copyright, licenses, email_url_info
OmkarPh Aug 4, 2023
2bc6bd2
Fixed scan errors in table & ScanInfo, and added tests for scanErrors
OmkarPh Aug 5, 2023
f37a0c5
Reorganized tests
OmkarPh Aug 8, 2023
07fb6b8
Merge remote-tracking branch 'origin/experiment/dependenciesViews' in…
OmkarPh Aug 10, 2023
fcc0400
Added tests for packages & dependencies, Setup Tests CI
OmkarPh Aug 10, 2023
ef7319d
Test ci - fix attempt1
OmkarPh Aug 12, 2023
41b53d2
Merge remote-tracking branch 'origin/experiment/dependenciesViews' in…
OmkarPh Aug 14, 2023
d361052
Merge remote-tracking branch 'origin/v4.0-react-typescript' into feat…
OmkarPh Aug 23, 2023
99b1d4b
Completed tests and refactoring for File tree, history & misc test
OmkarPh Aug 26, 2023
d25c101
Tests for tableview columns and filters
OmkarPh Aug 26, 2023
2ebe01b
Added latest sample scans & updated readme
OmkarPh Aug 26, 2023
989e44d
Updated publish comments & code formatting
OmkarPh Aug 28, 2023
9281b52
Implemented close file button, menu item and before new scan import
OmkarPh Sep 1, 2023
0d8163c
Fixed #590 scrolling irregularities in deeply nested filetree
OmkarPh Sep 2, 2023
644af13
Added dev script for docs & installation steps for centos
OmkarPh Sep 4, 2023
96d85b8
Setup precommit hooks for tests using husky
OmkarPh Sep 4, 2023
f6a0d84
Merged skeleton docs
OmkarPh Sep 11, 2023
f39c86a
Fixed previous title preserved on closing file
OmkarPh Sep 11, 2023
e54493f
Docs for Tableview
OmkarPh Sep 11, 2023
45c7367
Added directory-tree docs & column list for tableview
OmkarPh Sep 15, 2023
d87295a
Updated docs with latest information
OmkarPh Sep 24, 2023
89083c7
Removed year from project's copyright statements
OmkarPh Sep 25, 2023
9e96f9e
Fixed sphinx errors, changed requirements versions, formatting and bu…
OmkarPh Sep 25, 2023
ab53936
Fixed unnecessary scrolling on click, added working indicator for fil…
OmkarPh Oct 2, 2023
a9c97e8
Fixed #542 file icon being shown for empty directories
OmkarPh Oct 2, 2023
a3dd1b5
Merge pull request #599 from nexB/fix/scrolltofile
OmkarPh Oct 2, 2023
8688efd
Merge pull request #600 from nexB/feature/closefile
OmkarPh Oct 2, 2023
bc838c5
Merge branch 'feature/unittests' into update/docs
OmkarPh Oct 2, 2023
9eadc37
Updated documentation scripts
OmkarPh Oct 2, 2023
9eb26f0
Setup automatic height & max height for matches & file regions table
OmkarPh Oct 4, 2023
1626bab
Fixed auto height for package & dependency entity
OmkarPh Oct 5, 2023
d86c93f
Updated docs config, dark theme, UI reference updates
OmkarPh Oct 14, 2023
af16680
Updated config for readthedocs deploys
OmkarPh Oct 14, 2023
6c92d66
Completed UI references, refer-scans, sct-swb interlinks
OmkarPh Oct 16, 2023
be37218
Add minor fixes in workbench docs
AyanSinhaMahapatra Oct 16, 2023
241487f
Merge pull request #604 from nexB/fix/emptyDirectoryIcon
OmkarPh Oct 16, 2023
e397372
Handled summary table for packages without dependencies & adjusted ta…
OmkarPh Oct 17, 2023
7e00d58
Added Docs CI, fixed minor docs errors
OmkarPh Oct 17, 2023
e7914f4
Add minor doc updates
AyanSinhaMahapatra Oct 18, 2023
d21e55d
Merge pull request #606 from nexB/fix/autoTableDimensions
AyanSinhaMahapatra Oct 18, 2023
8a217c8
Updated underlying technology, build tools versions, removed policies…
OmkarPh Oct 19, 2023
4afe992
Updated jest config
OmkarPh Oct 22, 2023
8ed4e40
Merge pull request #602 from nexB/update/docs
AyanSinhaMahapatra Oct 25, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# name of your github action
name: Release
name: Release CI

# this will help you specify when & which branch to run deployment
on:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Test CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install
- run: npm test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Test residue
test-db

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# <p align="center"><img src="src/assets/images/scancode-workbench-logo.png" align="center" alt="ScanCode Workbench">
</p>

[![Travis Build Status](https://travis-ci.org/nexB/scancode-workbench.svg?branch=develop)](https://travis-ci.org/nexB/scancode-workbench)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/nexB/scancode-workbench)](https://ci.appveyor.com/project/nexB/scancode-workbench)
[![Test CI](https://github.com/nexB/scancode-workbench/actions/workflows/Test.yml/badge.svg)](https://github.com/nexB/scancode-workbench/actions/workflows/Test.yml)
[![Release](https://github.com/nexB/scancode-workbench/actions/workflows/Release.yml/badge.svg)](https://github.com/nexB/scancode-workbench/actions/workflows/Release.yml)

ScanCode Workbench provides an advanced visual UI to help you quickly evaluate
license and other notices identified by
Expand All @@ -22,7 +22,7 @@ works on Windows, OS X and Linux operating systems.

* You can [download the latest release](https://github.com/nexB/scancode-workbench/releases)
for your operating system or build it yourself (see below). Once downloaded, you
can find `ScanCode-Workbench` under `dist/ScanCode-Workbench-<os>-x64-<version>`.
can find `ScanCode-Workbench` under `dist/ScanCode-Workbench-<os>-<arch>-<version>`
* ScanCode Workbench >= v2 is only compatible with scans from
[ScanCode v2.0.0](https://github.com/nexB/scancode-toolkit/releases) and
above which are run with the ScanCode `-i` option. For a list of available ScanCode
Expand All @@ -40,9 +40,9 @@ information captured by a scan. The samples are located at
the [documentation](https://scancode-workbench.readthedocs.io) for more
information on how to use ScanCode Workbench.

![Import a JSON file](https://scancode-workbench.readthedocs.io/en/develop/_images/import-json-file.gif)
[Import a JSON file](https://scancode-workbench.readthedocs.io/en/develop/_images/import-json-file.gif)

## Building
## Running locally

You'll need [Node.js](https://nodejs.org) (which comes with [npm](http://npmjs.com))
installed on your computer in order to build this app. For a list of platform
Expand All @@ -65,23 +65,21 @@ $ npm start

## Release Instructions

You can build a `dist` directory containing executables for any one of three
target platforms by running:
You'll need python 3.x to run the build. You can build a `dist` directory containing executables for your platform

Note: Due to usage of native modules, a build must be done on target platform only.

```bash
$ python build.py
$ npm run publish
```

After building is done, you can find `ScanCode-Workbench` under
`dist/ScanCode-Workbench-<os>-x64-<version>`. Archives (tar.gz and .zip) are
also built.

Note: A build for any of the three target platforms must be executed on the
targeted platform.

## Testing

Test ABCM functionality using:
Run tests using:

```bash
$ npm test
Expand Down
6 changes: 3 additions & 3 deletions archive_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

# Prepare file name for archive using platform, architecture & app version
archive_file_name = '-'.join([APP_NAME, PLATFORM_NAME, ARCH, APP_VERSION])
print("Composed Archive file name: '" + archive_file_name + "'")
print(f"Composed Archive file name: '{archive_file_name}'")

# Ensure archive directory dist/ is created, before attempting to store archive inside it
ensure_archive_directory = f"mkdir -p {ARCHIVE_DIR}"
Expand All @@ -64,13 +64,13 @@
zip_command = f"powershell Compress-Archive {PACKAGE_DIR}/* {ARCHIVE_DIR}/{archive_file_name}.zip"
print("Executing zip command on powershell:", zip_command)
os.system(zip_command)
print(f"Zip file ready in {ARCHIVE_DIR}/ !!")
print(f"Zip file ready: {ARCHIVE_DIR}/{archive_file_name}.zip")

# Prepare .tar.gz file for mac & linux
else:
tar_command = f"tar -czf {ARCHIVE_DIR}/{archive_file_name}.tar.gz -C {PACKAGE_DIR} ."
print("Executing tar command:", tar_command)
os.system(tar_command)
print(f"Tar file ready in {ARCHIVE_DIR}/ !!")
print(f"Tar file ready: {ARCHIVE_DIR}/{archive_file_name}.tar.gz")

print("Build succeeded !!!")
44 changes: 44 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Virtual environment
venv/

# sphinx build folder
build/

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db

# Editor backup files #
#######################
*~
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
modulePathIgnorePatterns: ["test-old", "dist"],
testPathIgnorePatterns: ["node_modules", "dist", "test-old"]
};
Loading