Skip to content

Commit

Permalink
#42 Migrate Variations Checker to reso-certification-utils (#43)
Browse files Browse the repository at this point in the history
* #42: Migrated Variations Checker from reso-testing-utils

* #42: Eslint Issues

* #42: Updated README

* #42: Updated AWS SDK to v3

* #42: Intermediate commit - fixed scoring/lookupValue/legacyODataValue maps and added distance

* #42: Add additional verbose logging

* #42: Fix linter errors

* #42: Added some constants and additional methods

* #42: Added substring matching for shorter strings

* #42: Added DDWiki URLs to Resources and Fields

* #42: Intermediate check-in, nested lookups with suggestions

* #42: Added substring matching to enumerations for lookupValue

* #42: Added DDWiki URLs to Resources and Fields - check legacyODataValues

* #42: Deduplicated matched items

* #42: Fixed linter errors

* #42: Added version and debug flags

* #42: fix variations object

* #42: Remove set conversions

* #42: Updated scoring methodology and added stub for tests

* #42: Removed constant code for eslint

* #42: Ignore sample values and export from utils instead

* #42: Fixed Eslint Issues

* #42: Detect if running from the command line

* #42: Refactoring and cleanup, part 1

* #42: Improved matching code

* #42: Further cleanup

* #42: Added basic tests

* #42: Added 100% fuzziness tests

* #42: Fixed linter errors

* #42: Add GitHub Actions mocha test

* #42: Add GitHub Actions mocha test

* #42: Added resource substring matching tests

* #42: Refactored to use /lib directory

* #42: Refactored to use /lib directory

* #42: Added tests for exact matches with non-alpha noise

* #42: Added additional tests

* #42: Added standard and local variations tests

* #42: Updated package.json

* #42: Updated package.json

* Resolve comments

* Change to objects by default

---------

Co-authored-by: darnjo <josh@reso.org>
  • Loading branch information
darnjo and darnjo authored Sep 12, 2023
1 parent 12fecfa commit a2f57ca
Show file tree
Hide file tree
Showing 21 changed files with 1,519 additions and 3,886 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/codecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ jobs:
run: npm install -g eslint
- name: Install and run ESLint
run: eslint . --quiet
- name: Run Mocha Tests
run: npm install && npm test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ dist
# TernJS port file
.tern-port

config.json
.DS_Store
4 changes: 2 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"bracketSameLine": true,
"endOfLine": "lf",
"useTabs": false,
"printWidth": 110,
"printWidth": 140,
"proseWrap": "preserve"
}
}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ Restores a RESO Certification API Server using a set of existing results in a gi

[**MORE INFO**](./utils/restore-utils/README.md)

## Find Variations
Uses a number of techniques to find potential variations for local items contained in a Data Dictionary metadata report.

[**MORE INFO**](./utils/find-variations/README.md)


## Tests

To run the tests, clone the repository:
Expand Down
59 changes: 39 additions & 20 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
#! /usr/bin/env node
const { program } = require('commander');
const { restore } = require('./utils/restore-utils');
const { runTests } = require('./utils/batch-test-runner');
const { restore } = require('./lib/restore-utils');
const { runTests } = require('./lib/batch-test-runner');
const { findVariations, computeVariations } = require('./lib/find-variations/index.js');

program
.name('reso-certification-utils')
.description('Command line batch-testing and restore utils')
.version('0.0.2');
if (require?.main === module) {
const { program } = require('commander');

program
.command('restore')
.option('-p, --pathToResults <string>', 'Path to test results')
.option('-u, --url <string>', 'URL of Certification API')
.description('Restores local or S3 results to a RESO Certification API instance')
.action(restore);
program.name('reso-certification-utils').description('Command line batch-testing and restore utils').version('0.0.3');

program
.command('runDDTests')
.requiredOption('-p, --pathToConfigFile <string>', 'Path to config file')
.option('-a, --runAvailability', 'Flag to run data availability tests, otherwise only metadata tests are run')
.description('Runs Data Dictionary tests')
.action(runTests);
program
.command('restore')
.option('-p, --pathToResults <string>', 'Path to test results')
.option('-u, --url <string>', 'URL of Certification API')
.option('-c, --console <boolean>', 'Show output to console', true)
.description('Restores local or S3 results to a RESO Certification API instance')
.action(restore);

program.parse();
program
.command('runDDTests')
.requiredOption('-p, --pathToConfigFile <string>', 'Path to config file')
.option('-a, --runAvailability', 'Flag to run data availability tests, otherwise only metadata tests are run')
.option('-c, --console <boolean>', 'Show output to console', true)
.description('Runs Data Dictionary tests')
.action(runTests);

program
.command('findVariations')
.requiredOption('-p, --pathToMetadataReportJson <string>', 'Path to metadata-report.json file')
.option('-f, --fuzziness <float>', 'Set fuzziness to something besides the default')
.option('-v, --version <string>', 'Data Dictionary version to compare to, i.e. 1.7 or 2.0')
.option('-c, --console <boolean>', 'Show output to console', true)
.description('Finds possible variations in metadata using a number of methods.')
.action(findVariations);

program.parse();
}

module.exports = {
restore,
runTests,
findVariations,
computeVariations
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions lib/find-variations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Find Variations
This tool uses a number of techniques to find variations between Data Dictionary metadata and the given file.

To use, a Metadata Report is required.

Usage:

```
reso-certification-utils findVariations -p /path/to/metadata-report.json
```

Loading

0 comments on commit a2f57ca

Please sign in to comment.