Skip to content
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
8 changes: 8 additions & 0 deletions .canon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ csi-pi:
user: testbot
group: testbot
persistent: true

csi-test:
image_arm64: ghcr.io/viamrobotics/rdk-devenv:arm64-cache
minimum_date: 2023-10-26T20:00:00.0Z
update_interval: 168h0m0s
user: testbot
group: testbot
persistent: true
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ jobs:

- name: Build viam-csi appimage
run: make package

- name: Upload AppImage artifact
uses: actions/upload-artifact@v4
with:
name: viam-csi-${{ matrix.TARGET }}-appimage
path: etc/*.AppImage
retention-days: 1
66 changes: 66 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Integration Tests

on:
workflow_run:
workflows: ["Build Latest"]
types: [completed]
push:
branches:
- '*'
paths-ignore:
- 'README.md'
- 'docs/**'
pull_request:
branches:
- '*'
paths-ignore:
- 'README.md'
- 'docs/**'

permissions:
contents: read
actions: read

jobs:
integration-test:
name: Integration Tests
runs-on: buildjet-2vcpu-ubuntu-2204-arm
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
include:
- container: ghcr.io/viamrobotics/rdk-devenv:arm64-cache
TARGET: pi
container:
image: ${{ matrix.container }}
options: --platform linux/arm64

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Download AppImage artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yml
branch: ${{ github.head_ref || github.ref_name }}
workflow_conclusion: success
allow_forks: true
name: viam-csi-${{ matrix.TARGET }}-appimage
path: ./etc

- name: Make AppImage executable
run: chmod +x ./etc/*.AppImage

- name: Extract AppImage
run: |
cd ./etc
./*.AppImage --appimage-extract
chmod +x squashfs-root/AppRun

- name: Run integration tests
run: |
cd tests/integration
export VIAM_CSI_DEVICE=${{ matrix.TARGET }}
export VIAM_CSI_TEST_MODE=1
go test -v -timeout 10m
4 changes: 4 additions & 0 deletions constraints.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@
#define PI_INPUT_FORMAT "video/x-raw,format=NV12"
#define PI_VIDEO_CONVERTER "videoconvert"
#define PI_OUTPUT_ENCODER "jpegenc"

// Integration Tests
inline const std::string TEST_GST_PIPELINE =
"videotestsrc ! video/x-raw ! videoconvert ! jpegenc ! image/jpeg ! appsink name=appsink0 sync=false max-buffers=1 drop=true";
6 changes: 6 additions & 0 deletions csi_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ std::vector<unsigned char> CSICamera::get_csi_image() {
}

std::string CSICamera::create_pipeline() const {
const char* test_mode = std::getenv("VIAM_CSI_TEST_MODE");
if (test_mode != nullptr && std::string(test_mode) == "1") {
VIAM_SDK_LOG(warn) << "CI Test mode enabled";
return TEST_GST_PIPELINE;
}

auto device_params = get_device_params(device);
std::string input_sensor = (device.value == device_type::jetson) ? (" sensor-id=" + video_path) : "";

Expand Down
191 changes: 191 additions & 0 deletions tests/integration/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
module github.com/viam-modules/csi-camera/tests/integration

go 1.23.8

toolchain go1.23.10

require go.viam.com/rdk v0.83.0

require (
cloud.google.com/go v0.115.1 // indirect
cloud.google.com/go/auth v0.9.3 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.6.0 // indirect
cloud.google.com/go/iam v1.2.0 // indirect
cloud.google.com/go/storage v1.43.0 // indirect
git.sr.ht/~sbinet/gg v0.3.1 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/a8m/envsubst v1.4.2 // indirect
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect
github.com/apache/arrow/go/arrow v0.0.0-20201229220542-30ce2eb5d4dc // indirect
github.com/aptible/supercronic v0.2.33 // indirect
github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/bep/debounce v1.2.1 // indirect
github.com/bluenviron/gortsplib/v4 v4.8.0 // indirect
github.com/bufbuild/protocompile v0.9.0 // indirect
github.com/bytedance/sonic/loader v0.2.4 // indirect
github.com/campoy/embedmd v1.0.0 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/chenzhekl/goply v0.0.0-20190930133256-258c2381defd // indirect
github.com/chewxy/hm v1.0.0 // indirect
github.com/chewxy/math32 v1.0.8 // indirect
github.com/cloudwego/base64x v0.1.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgottlieb/smarty-assertions v1.2.6 // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/edaniels/golog v0.0.0-20230215213219-28954395e8d0 // indirect
github.com/edaniels/lidario v0.0.0-20220607182921-5879aa7b96dd // indirect
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fogleman/gg v1.3.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/fullstorydev/grpcurl v1.8.6 // indirect
github.com/gen2brain/malgo v0.11.21 // indirect
github.com/go-audio/audio v1.0.0 // indirect
github.com/go-audio/riff v1.0.0 // indirect
github.com/go-audio/transforms v0.0.0-20180121090939-51830ccc35a5 // indirect
github.com/go-audio/wav v1.1.0 // indirect
github.com/go-fonts/liberation v0.3.0 // indirect
github.com/go-gl/mathgl v1.0.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-nlopt/nlopt v0.0.0-20230219125344-443d3362dcb5 // indirect
github.com/go-pdf/fpdf v0.6.0 // indirect
github.com/go-viper/mapstructure/v2 v2.1.0 // indirect
github.com/goccy/go-graphviz v0.1.3 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/gonuts/binary v0.2.0 // indirect
github.com/google/flatbuffers v2.0.6+incompatible // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/jedib0t/go-pretty/v6 v6.4.6 // indirect
github.com/jhump/protoreflect v1.15.6 // indirect
github.com/kellydunn/golang-geo v0.7.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
github.com/kylelemons/go-gypsy v1.0.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx v1.2.29 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/lmittmann/ppm v1.0.2 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/miekg/dns v1.1.53 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/muesli/clusters v0.0.0-20200529215643-2700303c1762 // indirect
github.com/muesli/kmeans v0.3.1 // indirect
github.com/muhlemmer/gu v0.3.1 // indirect
github.com/pion/datachannel v1.5.8 // indirect
github.com/pion/dtls/v2 v2.2.12 // indirect
github.com/pion/ice/v2 v2.3.34 // indirect
github.com/pion/interceptor v0.1.29 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.12 // indirect
github.com/pion/mediadevices v0.6.4 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.14 // indirect
github.com/pion/rtp v1.8.7 // indirect
github.com/pion/sctp v1.8.33 // indirect
github.com/pion/sdp/v3 v3.0.9 // indirect
github.com/pion/srtp/v2 v2.0.20 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/transport/v2 v2.2.10 // indirect
github.com/pion/turn/v2 v2.1.6 // indirect
github.com/pion/webrtc/v3 v3.2.36 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/samber/lo v1.51.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/srikrsna/protoc-gen-gotag v0.6.2 // indirect
github.com/stretchr/testify v1.10.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/viamrobotics/ice/v2 v2.3.39 // indirect
github.com/viamrobotics/webrtc/v3 v3.99.15 // indirect
github.com/viamrobotics/zeroconf v1.0.12 // indirect
github.com/wlynxg/anet v0.0.3 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/xfmoulet/qoi v0.2.0 // indirect
github.com/xtgo/set v1.0.0 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
github.com/zitadel/oidc/v3 v3.37.0 // indirect
github.com/zitadel/schema v1.3.1 // indirect
github.com/ziutek/mymysql v1.5.4 // indirect
go-hep.org/x/hep v0.32.1 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.uber.org/goleak v1.3.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.viam.com/api v0.1.452 // indirect
go.viam.com/test v1.2.4 // indirect
go.viam.com/utils v0.1.149 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 // indirect
goji.io v2.0.2+incompatible // indirect
golang.org/x/arch v0.18.0 // indirect
golang.org/x/crypto v0.38.0 // indirect
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect
golang.org/x/image v0.19.0 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.14.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.25.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.33.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gonum.org/v1/gonum v0.12.0 // indirect
gonum.org/v1/plot v0.12.0 // indirect
google.golang.org/api v0.196.0 // indirect
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
google.golang.org/grpc v1.71.0 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorgonia.org/tensor v0.9.24 // indirect
gorgonia.org/vecf32 v0.9.0 // indirect
gorgonia.org/vecf64 v0.9.0 // indirect
nhooyr.io/websocket v1.8.7 // indirect
)
Loading