Skip to content

Commit

Permalink
vcan in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner authored Sep 21, 2023
1 parent 4df0fcb commit 37c4723
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- fix-workflow-tests
pull_request:
branches:
- main
Expand Down Expand Up @@ -33,6 +34,13 @@ jobs:
- name: (PREPARE) Install Node Modules
run: yarn --frozen-lockfile

- name: (PREPARE) Setup SocketCAN
run: |
sudo apt-get install -y can-utils libnode-dev linux-modules-extra-$(uname -r)
sudo modprobe can
sudo modprobe can_raw
sudo modprobe vcan
###################################################
#
# Test
Expand All @@ -48,4 +56,4 @@ jobs:
run: yarn style:check

- name: (TEST) Run Tests
run: yarn test
run: sudo yarn test
7 changes: 6 additions & 1 deletion src/core/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ export default class Message {
}

static fromCAN(message: CANMessage): Message {
return this.fromJSON({id: message.id, data: Array.from(message.data), ext: message.ext, rtr: message.rtr})
return this.fromJSON({
id: message.id,
data: Array.from(message.data),
ext: message.ext ?? false,
rtr: message.rtr ?? false,
})
}

toCAN(): CANMessage {
Expand Down
4 changes: 3 additions & 1 deletion tests/can/can.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as utils from '#utils'
import {expect} from 'chai'
import {afterEach} from 'mocha'

describe.skip('can', () => {
describe('can', () => {
const vcan = 'can2x'

beforeEach(async () => {
Expand Down Expand Up @@ -36,6 +36,8 @@ describe.skip('can', () => {
source: 'console',
sourceId: String(message.id),
sourceData: message.data.map(String),
sourceExt: message.ext,
sourceRtr: message.rtr,
target: 'can',
targetName: vcan,
})
Expand Down
4 changes: 3 additions & 1 deletion tests/complex/complex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {afterEach} from 'mocha'
/**
* console2can --(can2x1)--> can2socketio -> socketio2can --(can2x2)--> can2file
*/
describe.skip('complex', () => {
describe('complex', () => {
beforeEach(async () => {
try {
await actions.startVCAN({
Expand Down Expand Up @@ -56,6 +56,8 @@ describe.skip('complex', () => {
source: 'console',
sourceId: String(message.id),
sourceData: message.data.map(String),
sourceExt: message.ext,
sourceRtr: message.rtr,
target: 'can',
targetName: 'can2x1',
})
Expand Down

0 comments on commit 37c4723

Please sign in to comment.