Skip to content

Commit

Permalink
Merge branch 'iroha2-dev' into test_env_improvment
Browse files Browse the repository at this point in the history
Signed-off-by: Asem-Abdelhady <[email protected]>
  • Loading branch information
Asem-Abdelhady committed Jan 10, 2024
2 parents 395591a + 1b2b2cd commit 08b473f
Show file tree
Hide file tree
Showing 236 changed files with 8,425 additions and 12,377 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/iroha2-dev-pr-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches: [iroha-dev]
paths:
- 'docs/source/references/schema.json'
- 'docs/source/references/config.md'

jobs:
api-changes:
Expand All @@ -30,7 +29,7 @@ jobs:
continue-on-error: true
id: config_label
- uses: actions-ecosystem/action-add-labels@v1
if: contains(steps.config_label.outputs.added_modified, 'docs/source/references/config.md')
if: contains(steps.config_label.outputs.added_modified)
with:
github_token: ${{ secrets.github_token }}
labels: |
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/iroha2-dev-pr-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,25 @@ env:
RUSTUP_TOOLCHAIN: nightly-2023-06-25

jobs:
analysis:
smart_contracts_analysis:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2023-06-25
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2

- name: Default executor format
run: |
cd ./default_executor
mold --run cargo fmt --all -- --check
- name: Integration tests smart contracts format
run: |
cd ./client/tests/integration/smartcontracts
mold --run cargo fmt --all -- --check
workspace_analysis:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2023-06-25
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Check config.md
if: always()
run: ./scripts/tests/consistency.sh docs
- name: Check genesis.json
if: always()
run: ./scripts/tests/consistency.sh genesis
Expand Down Expand Up @@ -69,8 +66,7 @@ jobs:
uses: coverallsapp/github-action@v2
with:
file: lcov.info
compare-ref: ${{ github.base_ref }}
compare-sha: ${{ github.event.pull_request.base.sha}}
git-branch: ${{ github.base_ref }}
github-token: ${{ secrets.GITHUB_TOKEN }}
allow-empty: true
fail_ci_if_error: true
Expand Down
23 changes: 11 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ New to our project? [Make your first contribution](#your-first-code-contribution

### TL;DR

* Find [ZenHub](https://app.zenhub.com/workspaces/iroha-v2-60ddb820813b9100181fc060/board?repos=181739240).
* Fork [Iroha](https://github.com/hyperledger/iroha/tree/iroha2-dev).
* Fix your issue of choice.
* Ensure you follow our [style guides](#style-guides) for code and documentation.
* Write [tests](https://doc.rust-lang.org/cargo/commands/cargo-test.html). Ensure they all pass (`cargo test`).
* Fix [`clippy`](https://lib.rs/crates/cargo-lints) warnings: `cargo lints clippy --workspace --benches --tests --examples --all-features`.
* Format code `cargo +nightly fmt --all` and generate docs `cargo run --bin kagami -- docs >"docs/source/references/config.md" && git add "docs/source/references/config.md"`.
* With the `upstream` set to track [Hyperledger Iroha repository](https://github.com/hyperledger/iroha), `git pull -r upstream iroha2-dev`, `git commit -s`, `git push <your-fork>`, and [create a pull request](https://github.com/hyperledger/iroha/compare) to the `iroha2-dev` branch. Ensure the PR has the `[type] #<issue number>: Description` [title](#pull-request-titles).
- Find [ZenHub](https://app.zenhub.com/workspaces/iroha-v2-60ddb820813b9100181fc060/board?repos=181739240).
- Fork [Iroha](https://github.com/hyperledger/iroha/tree/iroha2-dev).
- Fix your issue of choice.
- Ensure you follow our [style guides](#style-guides) for code and documentation.
- Write [tests](https://doc.rust-lang.org/cargo/commands/cargo-test.html). Ensure they all pass (`cargo test --workspace`).
- Perform pre-commit routine like formatting & artifacts regeneration (see [`pre-commit.sample`](./hooks/pre-commit.sample))
- With the `upstream` set to track [Hyperledger Iroha repository](https://github.com/hyperledger/iroha), `git pull -r upstream iroha2-dev`, `git commit -s`, `git push <your-fork>`, and [create a pull request](https://github.com/hyperledger/iroha/compare) to the `iroha2-dev` branch. Ensure the PR has the `[type] #<issue number>: Description` [title](#pull-request-titles).

### Reporting Bugs

Expand Down Expand Up @@ -231,7 +230,7 @@ Follow these commit guidelines:
<details> <summary> Expand to learn how to change the log level or write logs to a JSON.</summary>
If one of your tests is failing, you may want to decrease the maximum logging level. By default, Iroha only logs `INFO` level messages, but retains the ability to produce both `DEBUG` and `TRACE` level logs. This setting can be changed either using the `MAX_LOG_LEVEL` environment variable for code-based tests, or using the `/configuration` endpoint on one of the peers in a deployed network.
If one of your tests is failing, you may want to decrease the maximum logging level. By default, Iroha only logs `INFO` level messages, but retains the ability to produce both `DEBUG` and `TRACE` level logs. This setting can be changed either using the `LOG_LEVEL` environment variable for code-based tests, or using the `/configuration` endpoint on one of the peers in a deployed network.
While logs printed in the `stdout` are sufficient, you may find it more convenient to produce `json`-formatted logs into a separate file and parse them using either [node-bunyan](https://www.npmjs.com/package/bunyan) or [rust-bunyan](https://crates.io/crates/bunyan).
Expand All @@ -251,16 +250,16 @@ In this case you should compile iroha with support of tokio console like that:
RUSTFLAGS="--cfg tokio_unstable" cargo build --features tokio-console
```

Port for tokio console can by configured through `TOKIO_CONSOLE_ADDR` configuration parameter (or environment variable).
Using tokio console require log level to be `TRACE`, can be enabled through configuration parameter or environment variable `MAX_LOG_LEVEL`.
Port for tokio console can by configured through `LOG_TOKIO_CONSOLE_ADDR` configuration parameter (or environment variable).
Using tokio console require log level to be `TRACE`, can be enabled through configuration parameter or environment variable `LOG_LEVEL`.

Example of running iroha with tokio console support using `scripts/test_env.sh`:

```bash
# 1. Compile iroha
RUSTFLAGS="--cfg tokio_unstable" cargo build --features tokio-console
# 2. Run iroha with TRACE log level
MAX_LOG_LEVEL=TRACE ./scripts/test_env.sh setup
LOG_LEVEL=TRACE ./scripts/test_env.sh setup
# 3. Access iroha. Peers will be available on ports 5555, 5556, ...
tokio-console http://127.0.0.1:5555
```
Expand Down
Loading

0 comments on commit 08b473f

Please sign in to comment.