Page MenuHomePhabricator

[Chronik] Rename `group` in `PluginOutput` to `groups`
ClosedPublic

Authored by tobias_ruck on Aug 22 2024, 12:22.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC1544301342f0: [Chronik] Rename `group` in `PluginOutput` to `groups`
Summary

Everywhere else in the code this is called groups (e.g. in the protobuf, and in PluginOutputEntry in tx.py), so it's inconsistent to have it be called group for the same thing.

This is a breaking change, but since plugins are still experimental and very few people are using them, it's better to do this change now than later.

Test Plan

./test/functional/test_runner.py chronik_plugins chronik_plugin_groups

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Tail of the build log:

test indexer::tests::test_plugin_versions ... ok
test indexer::tests::test_indexer ... ok
test indexer::tests::test_schema_version ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.73s

     Running unittests src/lib.rs (abc-ci-builds/build-chronik/cargo/build/debug/deps/chronik_plugin-2badf67924149a22)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (abc-ci-builds/build-chronik/cargo/build/debug/deps/chronik_plugin_common-4f8bf5e1fc6a5f26)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (abc-ci-builds/build-chronik/cargo/build/debug/deps/chronik_plugin_impl-e9ed059d27202e9d)

running 1 test
test context::tests::test_run_on_tx ... FAILED

failures:

---- context::tests::test_run_on_tx stdout ----
Plugin context initialized Python 3.9.2

Loaded plugin plg1.Plg1Plugin (version 0.0.0) with LOKAD IDs [b"PLG1"]

Loaded plugin plg2.Plg2Plugin (version 0.0.0) with LOKAD IDs [b"PLG2"]

thread 'context::tests::test_run_on_tx' panicked at chronik/chronik-plugin-impl/src/context.rs:604:17:
assertion failed: `(left == right)`

Diff < left / right > :
 PluginRunFailed {
     txid: TxId(0101010101010101010101010101010101010101010101010101010101010101),
     plugin_name: "plg1",
<    error: ThrewException(
<        "TypeError: <lambda>() got an unexpected keyword argument 'group'",
<    ),
>    error: IdxNotInt {
>        idx: 0,
>        obj_str: "'string'",
>    },
 }


note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    context::tests::test_run_on_tx

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

error: test failed, to rerun pass `-p chronik-plugin-impl --lib`
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik failed with exit code 1

Tail of the build log:

test indexer::tests::test_plugin_versions ... ok
test indexer::tests::test_indexer ... ok
test indexer::tests::test_schema_version ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.66s

     Running unittests src/lib.rs (abc-ci-builds/build-chronik-plugins/cargo/build/debug/deps/chronik_plugin-2badf67924149a22)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (abc-ci-builds/build-chronik-plugins/cargo/build/debug/deps/chronik_plugin_common-4f8bf5e1fc6a5f26)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (abc-ci-builds/build-chronik-plugins/cargo/build/debug/deps/chronik_plugin_impl-e9ed059d27202e9d)

running 1 test
test context::tests::test_run_on_tx ... FAILED

failures:

---- context::tests::test_run_on_tx stdout ----
Plugin context initialized Python 3.9.2

Loaded plugin plg1.Plg1Plugin (version 0.0.0) with LOKAD IDs [b"PLG1"]

Loaded plugin plg2.Plg2Plugin (version 0.0.0) with LOKAD IDs [b"PLG2"]

thread 'context::tests::test_run_on_tx' panicked at chronik/chronik-plugin-impl/src/context.rs:604:17:
assertion failed: `(left == right)`

Diff < left / right > :
 PluginRunFailed {
     txid: TxId(0101010101010101010101010101010101010101010101010101010101010101),
     plugin_name: "plg1",
<    error: ThrewException(
<        "TypeError: <lambda>() got an unexpected keyword argument 'group'",
<    ),
>    error: IdxNotInt {
>        idx: 0,
>        obj_str: "'string'",
>    },
 }


note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    context::tests::test_run_on_tx

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

error: test failed, to rerun pass `-p chronik-plugin-impl --lib`
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik-plugins failed with exit code 1

Tail of the build log:

  File "/work/test/functional/setup_scripts/../test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/setup_scripts/../test_framework/authproxy.py", line 176, in __call__
    response, status = self._request(
  File "/work/test/functional/setup_scripts/../test_framework/authproxy.py", line 124, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/usr/lib/python3.9/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/lib/python3.9/http/client.py", line 950, in send
    self.connect()
  File "/usr/lib/python3.9/http/client.py", line 921, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.9/socket.py", line 843, in create_connection
    raise err
  File "/usr/lib/python3.9/socket.py", line 831, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused


TEST                                          | STATUS    | DURATION

setup_scripts/chronik-client_plugin_groups.py | ✖ Failed  | 4 s

ALL                                           | ✖ Failed  | 4 s (accumulated) 
Runtime: 4 s

Test runner for chronik-client_plugin_groups completed with code 1
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |   27.67 |     8.46 |   24.95 |   27.59 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |   20.51 |     6.19 |   14.49 |   20.69 |                                    
  chronik.ts          |   20.51 |     6.19 |   14.49 |   20.69 | ...3,6059-6062,6068-6110,6145-6154 
 chronik-client/src   |   62.05 |    38.06 |   60.16 |   61.21 |                                    
  ChronikClient.ts    |   52.87 |    35.33 |   56.66 |   52.87 | ...2,1164,1174,1195-1203,1211-1276 
  failoverProxy.ts    |   79.43 |    56.66 |   69.23 |   78.84 | ...282-285,288,297,304,308,313,317 
  hex.ts              |   89.47 |       50 |      75 |   87.87 | 58,66-68                           
  validation.ts       |   66.66 |    18.18 |   66.66 |   62.96 | 17,21,33,38-49,62-63               
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='816']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='2949']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='209']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2470']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='134']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='537']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='805']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='2917']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/chronik-client-integration-tests-junit.xml': No such file or directory
Build chronik-client-integration-tests failed with exit code 1

Tail of the build log:

   Doc-tests chronik-bridge

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-db

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-http

running 1 test
test chronik/chronik-http/src/protobuf.rs - protobuf::Protobuf (line 29) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.35s

   Doc-tests chronik-indexer

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-plugin

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-plugin-common

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-plugin-impl

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-proto

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-util

running 2 tests
test chronik/chronik-util/src/log.rs - log::log (line 65) ... ignored
test chronik/chronik-util/src/log.rs - log::log_chronik (line 87) ... ignored

test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s

ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik-plugins failed with exit code 1

Tail of the build log:

  File "/work/test/functional/setup_scripts/../test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/setup_scripts/../test_framework/authproxy.py", line 176, in __call__
    response, status = self._request(
  File "/work/test/functional/setup_scripts/../test_framework/authproxy.py", line 124, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/usr/lib/python3.9/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/lib/python3.9/http/client.py", line 950, in send
    self.connect()
  File "/usr/lib/python3.9/http/client.py", line 921, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.9/socket.py", line 843, in create_connection
    raise err
  File "/usr/lib/python3.9/socket.py", line 831, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused


TEST                                          | STATUS    | DURATION

setup_scripts/chronik-client_plugin_groups.py | ✖ Failed  | 4 s

ALL                                           | ✖ Failed  | 4 s (accumulated) 
Runtime: 4 s

Test runner for chronik-client_plugin_groups completed with code 1
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |   27.67 |     8.46 |   24.95 |   27.59 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |   20.51 |     6.19 |   14.49 |   20.69 |                                    
  chronik.ts          |   20.51 |     6.19 |   14.49 |   20.69 | ...3,6059-6062,6068-6110,6145-6154 
 chronik-client/src   |   62.05 |    38.06 |   60.16 |   61.21 |                                    
  ChronikClient.ts    |   52.87 |    35.33 |   56.66 |   52.87 | ...2,1164,1174,1195-1203,1211-1276 
  failoverProxy.ts    |   79.43 |    56.66 |   69.23 |   78.84 | ...282-285,288,297,304,308,313,317 
  hex.ts              |   89.47 |       50 |      75 |   87.87 | 58,66-68                           
  validation.ts       |   66.66 |    18.18 |   66.66 |   62.96 | 17,21,33,38-49,62-63               
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='816']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='2949']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='209']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2470']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='134']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='537']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='805']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='2917']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/chronik-client-integration-tests-junit.xml': No such file or directory
Build chronik-client-integration-tests failed with exit code 1

Tail of the build log:

    Checking url v2.5.0
    Checking rand v0.8.5
    Checking tracing v0.1.40
    Checking http-body-util v0.1.1
    Checking chronik-util v0.1.0 (/work/chronik/chronik-util)
    Checking sha1 v0.10.6
    Checking httpdate v1.0.3
    Checking cobs v0.2.3
    Checking smallvec v1.13.2
    Checking utf-8 v0.7.6
    Checking ryu v1.0.17
    Checking data-encoding v2.5.0
    Checking embedded-io v0.4.0
    Checking pin-project v1.1.5
    Checking postcard v1.0.8
    Checking chronik-plugin-common v0.1.0 (/work/chronik/chronik-plugin-common)
    Checking tungstenite v0.21.0
   Compiling prost-build v0.11.9
    Checking chronik-plugin v0.1.0 (/work/chronik/chronik-plugin)
    Checking toml_datetime v0.6.6
    Checking serde_spanned v0.6.6
   Compiling pyo3 v0.22.2
    Checking sync_wrapper v0.1.2
    Checking mime v0.3.17
    Checking winnow v0.6.13
    Checking hyper v1.2.0
    Checking seahash v4.1.0
    Checking topo_sort v0.4.0
    Checking axum-core v0.4.3
    Checking tower v0.4.13
    Checking tokio-tungstenite v0.21.0
    Checking memoffset v0.9.1
    Checking serde_json v1.0.115
    Checking serde_urlencoded v0.7.1
    Checking futures-executor v0.3.30
    Checking hyper-util v0.1.3
    Checking serde_path_to_error v0.1.16
    Checking base64 v0.21.7
    Checking unindent v0.2.3
    Checking matchit v0.7.3
    Checking sync_wrapper v1.0.1
    Checking unicode-segmentation v1.11.0
    Checking futures v0.3.30
    Checking tower-http v0.5.2
   Compiling chronik-proto v0.1.0 (/work/chronik/chronik-proto)
    Checking convert_case v0.6.0
   Compiling chronik-bridge v0.1.0 (/work/chronik/chronik-bridge)
    Checking toml_edit v0.22.14
   Compiling librocksdb-sys v0.11.0+8.1.1
    Checking axum v0.7.5
   Compiling pyo3-macros v0.22.2
    Checking toml v0.8.14
    Checking chronik-plugin-impl v0.1.0 (/work/chronik/chronik-plugin-impl)
    Checking rocksdb v0.21.0
    Checking chronik-db v0.1.0 (/work/chronik/chronik-db)
    Checking chronik-indexer v0.1.0 (/work/chronik/chronik-indexer)
    Checking chronik-http v0.1.0 (/work/chronik/chronik-http)
    Finished dev [unoptimized + debuginfo] target(s) in 6m 32s
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik-plugins failed with exit code 1
Build build-chronik-plugins failed with exit code 1

It is mysterious. I don't see any explcit error except for that one.

fix hopefully the last test

This revision is now accepted and ready to land.Aug 22 2024, 19:49