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 all 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
36 changes: 36 additions & 0 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI Documentation

on: [push, pull_request]

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build:
runs-on: ubuntu-20.04

strategy:
max-parallel: 4
matrix:
python-version: [3.9]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: pip install -r docs/requirements.txt

- name: Check Sphinx Documentation build minimally
working-directory: ./docs
run: sphinx-build -E -W source build

- name: Check for documentation style errors
working-directory: ./docs
run: ./scripts/doc8_style_check.sh

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
26 changes: 26 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build PDF & ePub
formats:
- epub
- pdf

# Where the Sphinx conf.py file is located
sphinx:
configuration: docs/source/conf.py

# specify build OS
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Setting the python version and doc build requirements
python:
install:
- requirements: docs/requirements.txt
86 changes: 86 additions & 0 deletions CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
Contributor Covenant Code of Conduct
====================================

Our Pledge
----------

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our
project and our community a harassment-free experience for everyone,
regardless of age, body size, disability, ethnicity, gender identity and
expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

Our Standards
-------------

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual
attention or advances
- Trolling, insulting/derogatory comments, and personal or political
attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or
electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

Our Responsibilities
--------------------

Project maintainers are responsible for clarifying the standards of
acceptable behavior and are expected to take appropriate and fair
corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit,
or reject comments, commits, code, wiki edits, issues, and other
contributions that are not aligned to this Code of Conduct, or to ban
temporarily or permanently any contributor for other behaviors that they
deem inappropriate, threatening, offensive, or harmful.

Scope
-----

This Code of Conduct applies both within project spaces and in public
spaces when an individual is representing the project or its community.
Examples of representing a project or community include using an
official project e-mail address, posting via an official social media
account, or acting as an appointed representative at an online or
offline event. Representation of a project may be further defined and
clarified by project maintainers.

Enforcement
-----------

Instances of abusive, harassing, or otherwise unacceptable behavior may
be reported by contacting the project team at pombredanne@gmail.com
or on the Gitter chat channel at https://matrix.to/#/#aboutcode-org_discuss:gitter.im
All complaints will be reviewed and investigated and will result in a
response that is deemed necessary and appropriate to the circumstances.
The project team is obligated to maintain confidentiality with regard to
the reporter of an incident. Further details of specific enforcement
policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in
good faith may face temporary or permanent repercussions as determined
by other members of the project’s leadership.

Attribution
-----------

This Code of Conduct is adapted from the `Contributor Covenant`_ ,
version 1.4, available at
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

.. _Contributor Covenant: https://www.contributor-covenant.org
32 changes: 15 additions & 17 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 @@ -11,7 +11,7 @@ license and other notices identified by
and other interesting information in your code.

ScanCode Workbench is based on
[Electron](https://electron.atom.io/) and will be the primary desktop/GUI tool
[Electron](https://www.electronjs.org/) and will be the primary desktop/GUI tool
for using nexB’s [AboutCode tools](https://github.com/nexB/aboutcode). This app
works on Windows, OS X and Linux operating systems.

Expand All @@ -22,9 +22,9 @@ 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>`.
* ScanCode Workbench >= v2 is only compatible with scans from
[ScanCode v2.0.0](https://github.com/nexB/scancode-toolkit/releases) and
can find `ScanCode-Workbench` under `dist/ScanCode-Workbench-<os>-<arch>-<version>`
* ScanCode Workbench >= v4 is only compatible with scans from
[ScanCode v32.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
options see [How To: Set what will be detected in a scan](https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_set_what_will_be_detected_in_a_scan.html)

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 All @@ -98,6 +96,6 @@ See the NOTICE file for more details.

If you have a question, a suggestion or find a bug, enter an issue.

[![Gitter chat](https://badges.gitter.im/aboutcode-org/gitter.png)](https://gitter.im/aboutcode-org/discuss)
[![Gitter chat](https://badges.gitter.im/aboutcode-org/gitter.png)](https://matrix.to/#/#aboutcode-org_discuss:gitter.im)

For questions and chats, you can join the Gitter channel at https://gitter.im/aboutcode-org/discuss
For questions and chats, you can join the Gitter channel at https://matrix.to/#/#aboutcode-org_discuss:gitter.im
File renamed without changes.
8 changes: 4 additions & 4 deletions archive_builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (c) 2017 - 2019 nexB Inc. http://www.nexb.com/ - All rights reserved.
# Copyright (c) nexB Inc. and others. All rights reserved.

"""
Run this script to build ScanCode Workbench. The script detects which OS
Expand Down 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 !!!")
4 changes: 2 additions & 2 deletions attribution.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ <h2>About ScanCode Workbench 4.0.0:</h2>
</p>

<pre>
Copyright (c) 2016 - 2019 nexB Inc. and others. All rights reserved.</pre
Copyright (c) nexB Inc. and others. All rights reserved.</pre
>
<pre>
Software license
================

Copyright (c) 2016 nexB Inc. and others. All rights reserved.
Copyright (c) nexB Inc. and others. All rights reserved.
https://nexb.com and https://github.com/nexB/scancode-workbench/
The ScanCode Workbench software is licensed under the Apache License version 2.0.
ScanCode is a trademark of nexB Inc.
Expand Down
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 #
#######################
*~
Loading