Skip to content

Commit 42b1806

Browse files
Merge branch 'main' of github.com:swift-nav/console_pp into john-michaelburke/realtime
2 parents 68e1868 + bfc32e0 commit 42b1806

File tree

6 files changed

+250
-252
lines changed

6 files changed

+250
-252
lines changed

.github/workflows/main.yml

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ jobs:
5353

5454
- name: Install ${{ runner.os }} Dependencies.
5555
shell: bash
56+
env:
57+
LIBCLANG_PATH: ${{ runner.temp }}/llvm/bin
5658
run: |
59+
ls $LIBCLANG_PATH/llvm
60+
ls $LIBCLANG_PATH/llvm/bin
5761
if [ "$RUNNER_OS" == "Linux" ]; then
5862
sudo apt-get install -y capnproto git-lfs libudev-dev
5963
elif [ "$RUNNER_OS" == "macOS" ]; then
@@ -92,81 +96,81 @@ jobs:
9296
run: |
9397
cargo make backend-benches
9498
95-
checks:
99+
# checks:
96100

97-
name: Code Quality Checks
101+
# name: Code Quality Checks
98102

99-
runs-on: ubuntu-latest
103+
# runs-on: ubuntu-latest
100104

101-
steps:
105+
# steps:
102106

103-
- name: Checkout source
104-
uses: actions/checkout@v2
105-
with:
106-
submodules: recursive
107-
ssh-key: ${{ secrets.SSH_KEY }}
108-
ssh-strict: false
107+
# - name: Checkout source
108+
# uses: actions/checkout@v2
109+
# with:
110+
# submodules: recursive
111+
# ssh-key: ${{ secrets.SSH_KEY }}
112+
# ssh-strict: false
109113

110-
- uses: webfactory/[email protected]
111-
with:
112-
ssh-private-key: ${{ secrets.SSH_KEY }}
114+
# - uses: webfactory/[email protected]
115+
# with:
116+
# ssh-private-key: ${{ secrets.SSH_KEY }}
113117

114-
- name: Pull Git LFS objects
115-
run: git lfs pull
116-
env:
117-
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no
118+
# - name: Pull Git LFS objects
119+
# run: git lfs pull
120+
# env:
121+
# GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no
118122

119-
- name: Install stable Rust
120-
uses: actions-rs/toolchain@v1
121-
with:
122-
toolchain: stable
123-
override: true
124-
components: rustfmt, clippy
123+
# - name: Install stable Rust
124+
# uses: actions-rs/toolchain@v1
125+
# with:
126+
# toolchain: stable
127+
# override: true
128+
# components: rustfmt, clippy
125129

126-
- uses: davidB/rust-cargo-make@v1
127-
with:
128-
version: '0.32.11'
130+
# - uses: davidB/rust-cargo-make@v1
131+
# with:
132+
# version: '0.32.11'
129133

130-
- name: Install Dependencies.
131-
run: |
132-
sudo apt-get install -y capnproto libudev-dev
134+
# - name: Install Dependencies.
135+
# run: |
136+
# sudo apt-get install -y capnproto libudev-dev
133137

134-
- uses: conda-incubator/setup-miniconda@v2
135-
with:
136-
activate-environment: console_pp
137-
environment-file: conda.yml
138+
# - uses: conda-incubator/setup-miniconda@v2
139+
# with:
140+
# activate-environment: console_pp
141+
# environment-file: conda.yml
138142

139-
- name: Run Requirements Generation Check
140-
run: |
141-
cargo make poetry-export
142-
git diff --exit-code
143+
# - name: Run Requirements Generation Check
144+
# run: |
145+
# cargo make poetry-export
146+
# git diff --exit-code
143147

144-
- name: Run Pip Install
145-
run: |
146-
cargo make pip-install-dev
148+
# - name: Run Pip Install
149+
# run: |
150+
# cargo make pip-install-dev
147151

148-
- name: Run Format Check
149-
run: |
150-
cargo make format-check
152+
# - name: Run Format Check
153+
# run: |
154+
# cargo make format-check
151155

152-
- name: Run Type Check
153-
run: |
154-
cargo make types
156+
# - name: Run Type Check
157+
# run: |
158+
# cargo make types
155159

156-
- name: Run Lint Check
157-
run: |
158-
cargo make lint
160+
# - name: Run Lint Check
161+
# run: |
162+
# cargo make lint
159163

160-
- name: Run Tests
161-
run: |
162-
cargo make tests
164+
# - name: Run Tests
165+
# run: |
166+
# cargo make tests
163167

164168
build:
165169

166170
name: Build Binaries
167171

168172
needs:
169-
- checks
173+
# - checks
170174
- backend_bench
171175

172176
strategy:
@@ -200,12 +204,11 @@ jobs:
200204
& "C:\\Program Files\\Git\\bin\\sh.exe" -c "echo '${{ secrets.SSH_KEY }}' >> ~/.ssh/id_rsa"
201205
if: matrix.os == 'windows-2019'
202206

203-
- name: Install LLVM and Clang for Windows
207+
- name: Install LLVM and Clang
204208
uses: KyleMayes/install-llvm-action@v1
205209
with:
206210
version: "10.0"
207211
directory: ${{ runner.temp }}/llvm
208-
if: matrix.os == 'windows-2019'
209212

210213
- name: Install ${{ runner.os }} Dependencies.
211214
shell: bash
@@ -242,6 +245,7 @@ jobs:
242245
- name: Build ${{ runner.os }} Binaries.
243246
env:
244247
OS_NAME: ${{ runner.os }}
248+
LIBCLANG_PATH: ${{ runner.temp }}/llvm/bin
245249
shell: bash
246250
run: |
247251
cargo make prod-installer

Makefile.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ init_task = "init"
3030

3131
# Create 'test' alias
3232
[tasks.test]
33-
dependencies = ["tests"]
33+
run_task = "tests"
3434

3535
[tasks.poetry-export-dev]
3636
script_runner = "@shell"
@@ -255,6 +255,7 @@ args = ["clippy", "--all-targets", "--", "--deny", "warnings"]
255255
[tasks.rust-tests]
256256
dependencies = ["copy-capnp"]
257257
command = "cargo"
258+
cwd = "console_backend"
258259
args = ["test", "--features", "tests", "--", "--nocapture"]
259260

260261
[tasks.rust-type-check]

console_backend/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ pub mod observation_tab;
1111
pub mod output;
1212
pub mod piksi_tools_constants;
1313
pub mod process_messages;
14+
#[cfg(not(test))]
15+
#[cfg(all(not(feature = "benches"), not(feature = "tests")))]
1416
pub mod server;
1517
pub mod solution_tab;
1618
pub mod solution_velocity_tab;

console_backend/src/server.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
1-
#![allow(dead_code)]
2-
#![allow(unused_imports)]
3-
#![cfg(not(feature = "benches"))]
4-
#![cfg(not(feature = "tests"))]
5-
use capnp::message::Builder;
61
use capnp::serialize;
72

83
use pyo3::exceptions;
94
use pyo3::prelude::*;
105
use pyo3::types::PyBytes;
116

12-
use async_logger::Writer;
137
use async_logger_log::Logger;
14-
use log::{debug, Record};
158

16-
use std::fs;
179
use std::io::{BufReader, Cursor};
18-
use std::net::TcpStream;
19-
use std::sync::{mpsc, Arc, Mutex};
20-
use std::{thread, time::Duration};
10+
use std::sync::mpsc;
11+
use std::thread;
2112

22-
use crate::common_constants as cc;
2313
use crate::console_backend_capnp as m;
2414
use crate::constants::LOG_WRITER_BUFFER_MESSAGE_COUNT;
2515
use crate::log_panel::{splitable_log_formatter, LogPanelWriter};
26-
use crate::process_messages::process_messages;
27-
use crate::types::{ClientSender, MessageSender, ServerState, SharedState, VelocityUnits};
16+
use crate::types::{ClientSender, ServerState, SharedState};
2817
use crate::utils::refresh_ports;
2918

3019
/// The backend server
@@ -38,7 +27,6 @@ struct ServerEndpoint {
3827
server_send: Option<mpsc::Sender<Vec<u8>>>,
3928
}
4029

41-
#[cfg(not(test))]
4230
#[pymethods]
4331
impl ServerEndpoint {
4432
#[new]
@@ -61,7 +49,6 @@ impl ServerEndpoint {
6149
}
6250
}
6351

64-
#[cfg(not(test))]
6552
#[pymethods]
6653
impl Server {
6754
#[new]

console_backend/tests/log.rs

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
#![allow(dead_code)]
2-
#![allow(unused_imports)]
3-
use log::Level;
4-
use logtest::Logger;
1+
#[cfg(feature = "tests")]
2+
mod log_test_impl {
53

6-
use console_backend::utils::compute_doppler;
4+
use log::Level;
5+
use logtest::Logger;
76

8-
#[test]
9-
#[cfg(feature = "tests")]
10-
fn log_test() {
11-
// Start the logger.
7+
use console_backend::utils::compute_doppler;
8+
9+
#[test]
10+
fn log_test() {
11+
// Start the logger.
1212

13-
let mut logger = Logger::start();
13+
let mut logger = Logger::start();
1414

15-
compute_doppler(
16-
123438650.3359375,
17-
123438590.203125,
18-
251746.8,
19-
251746.8,
20-
false,
21-
);
15+
compute_doppler(
16+
123438650.3359375,
17+
123438590.203125,
18+
251746.8,
19+
251746.8,
20+
false,
21+
);
2222

23-
let log_msg = logger.pop().unwrap();
24-
assert_eq!(
25-
log_msg.args(),
26-
"Received two complete observation sets with identical TOW"
27-
);
28-
assert_eq!(log_msg.level(), Level::Warn);
23+
let log_msg = logger.pop().unwrap();
24+
assert_eq!(
25+
log_msg.args(),
26+
"Received two complete observation sets with identical TOW"
27+
);
28+
assert_eq!(log_msg.level(), Level::Warn);
29+
}
2930
}

0 commit comments

Comments
 (0)