Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,5 @@
}
}
},
"ignorePatterns": [
"integration"
]
"ignorePatterns": []
}
11 changes: 0 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,6 @@ jobs:
- name: Compile project
run: npm run compile

- name: Run integration tests
run: npm run integration-tests
env:
TRUSTIFY_DA_BACKEND_URL: 'https://exhort.stage.devshift.net'

- name: Run integration tests cli
working-directory: integration
run: bash ./run_its.sh
env:
TRUSTIFY_DA_BACKEND_URL: 'https://exhort.stage.devshift.net'

- name: Upload coverage reports
if: ${{ matrix.node == env.MAIN_NODE_VER }}
uses: actions/upload-artifact@v4
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ node_modules
dist
http_requests
json_responses
integration/**/package-lock.json
unit-tests-result.json
.gradle
build
Expand Down
43 changes: 2 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,49 +67,10 @@ excluded from both linting and coverage.
to the _Backend_.
Use [java_maven.js](src/providers/java_maven.js) as an example to get you started.
* Import the new _Provider_ and list in the in _availableProviders_ array in [provider.js](src/provider.js).
* Update the _choices_ configuration for the _manifest-name_ positional argument in [cli.js](src/cli.js).
* Add Integration Test scenarios for the added provider in [integration/scenarios](integration/scenarios).
Use the [java scenarios](integration/scenarios/maven) as an example.
* Update the _choices_ configuration for the _manifest-name_ positional argument in [cli.js](src/cli.js).
* Add Integration Test scenarios for the added provider in the [trustification/integration](https://github.com/trustification/exhort-integration-tests/) repository.
* Update the documentation. This document and [README.md](README.md).

### Integration Tests

Integration tests are performed with a _bash_ script executing _node_ scripts.<br/>
In [integration/run_its.sh](integration/run_its.sh) we start with a function called _match_ taking 2 arguments:
* `$1` is a file name for the holding the expected result (scenarios)
* `$2` is a command execution for evaluation (testers)

The _match_ function will match the content of the file to the output of the command.
Typically, test cases in [integration/run_its.sh](integration/run_its.sh) will invoke the _match_ function with
a scenario from the [integration/scenarios](integration/scenarios) and a _node_ command invoking one of the _node_
scripts in [integration/testers](integration/testers).<br/>

We have 3 _testers_:
* [integration/testers/cli](integration/testers/cli) is a _package.json_ used for installing the _ESM module_.
Invoking the CLI Script is done against the _@trustify-da/trustify-da-javascript-client/dist/src/cli.js_ in the tester's
_node_modules_.
* [integration/testers/javascript](integration/testers/javascript) is a _javascript_ script invoking the _ESM module_.
* [integration/testers/typescript](integration/testers/typescript) is a _typescript_ script invoking the _ESM module_.

Run integration tests from the project's root:

> Don't forget to run `npm run compile` before running the integration tests.

```shell
(cd integration/ && bash ./run_its.sh)
```

Integration tests are executed against a mocked _Backend_ server.<br/>
If you need to run against the actual _Backend_ server, use the _TRUSTIFY_DA_ITS_USE_REAL_API_ environment variable:

```shell
(cd integration/ && TRUSTIFY_DA_ITS_USE_REAL_API=true bash ./run_its.sh)
```

The mocked server implementation is [integration/server/mock_server.js](integration/server/mock_server.js). See the
[integration/server/mock_server_config.json](integration/server/mock_server_config.json) for configuring the mock
server.

## Certificate of Origin

By contributing to this project you agree to the Developer Certificate of
Expand Down
153 changes: 0 additions & 153 deletions integration/run_its.sh

This file was deleted.

1 change: 0 additions & 1 deletion integration/scenarios/maven/component_request_json

This file was deleted.

Loading
Loading