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

Add doc test run in CI #2230

Merged
merged 2 commits into from
Mar 5, 2020
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
12 changes: 6 additions & 6 deletions runtime/near-vm-logic/src/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ pub trait External {
/// # let mut external = MockedExternal::new();
/// let result = external.keccak256(b"tesdsst").unwrap();
/// assert_eq!(&result, &[
/// 174, 42, 184, 134, 113, 104, 230, 180, 244, 77, 240, 72, 199, 42, 110, 178, 6, 168,
/// 121, 77, 27, 183, 153, 108, 197, 171, 78, 61, 186, 133, 193, 182
/// 104, 110, 58, 122, 230, 181, 215, 145, 231, 229, 49, 162, 123, 167, 177, 58, 26, 142,
/// 129, 173, 7, 37, 9, 26, 233, 115, 64, 102, 61, 85, 10, 159
/// ]);
///
/// ```
Expand All @@ -581,10 +581,10 @@ pub trait External {
/// # let mut external = MockedExternal::new();
/// let result = external.keccak512(b"tesdsst").unwrap();
/// assert_eq!(&result, &[
/// 133, 196, 48, 30, 203, 238, 194, 158, 186, 246, 118, 238, 42, 158, 212, 27, 178, 72,
/// 90, 229, 98, 108, 195, 221, 222, 161, 96, 219, 252, 99, 2, 48, 224, 15, 95, 220, 35,
/// 209, 27, 250, 43, 168, 250, 10, 21, 25, 97, 135, 235, 61, 5, 142, 182, 85, 36, 179,
/// 23, 126, 161, 14, 21, 118, 180, 231
/// 55, 134, 96, 137, 168, 122, 187, 95, 67, 76, 18, 122, 146, 11, 225, 106, 117, 194, 154,
/// 157, 48, 160, 90, 146, 104, 209, 118, 126, 222, 230, 200, 125, 48, 73, 197, 236, 123,
/// 173, 192, 197, 90, 153, 167, 121, 100, 88, 209, 240, 137, 86, 239, 41, 87, 128, 219, 249,
/// 136, 203, 220, 109, 46, 168, 234, 190
/// ].to_vec());
///
/// ```
Expand Down
3 changes: 2 additions & 1 deletion scripts/parallel_run_tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
import os
from testlib import clean_binary_tests, build_tests, test_binaries, workers, run_test
from testlib import clean_binary_tests, build_tests, test_binaries, workers, run_test, run_doc_tests
from concurrent.futures import as_completed, ThreadPoolExecutor

RERUN_THRESHOLD = 5
Expand All @@ -16,6 +16,7 @@ def show_test_result(binary, result):

if __name__ == "__main__":
clean_binary_tests()
run_doc_tests()
build_tests()
binaries = test_binaries(exclude=[r'test_regression-.*', r'near_rpc_error_macro-.*'])
print(f'========= collected {len(binaries)} test binaries:')
Expand Down
6 changes: 6 additions & 0 deletions scripts/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def build_tests():
os._exit(p.returncode)


def run_doc_tests():
p = subprocess.run(['cargo', 'test', '--workspace', '--doc'])
if p.returncode != 0:
os._exit(p.returncode)


def workers():
workers = cpu_count() // 2
print(f'========= run in {workers} workers')
Expand Down