Skip to content

Commit

Permalink
[cueweb] Add tests to ci/cd pipeline
Browse files Browse the repository at this point in the history
- Adding cueweb tests to the opencue ci/cd pipeline
  • Loading branch information
Zach-Fong committed Nov 27, 2024
1 parent 032f701 commit 4174bb4
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 4 deletions.
61 changes: 59 additions & 2 deletions .github/workflows/testing-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: OpenCue Testing Pipeline

on:
push:
branches: [ master ]
branches: [ master, cueweb ]
pull_request:
branches: [ master ]
branches: [ master, cueweb ]

jobs:
test_python_2022:
Expand Down Expand Up @@ -104,6 +104,63 @@ jobs:
- name: Run Sphinx build
run: ci/build_sphinx_docs.sh

test_cueweb:
name: Run CueWeb Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 21.x
- name: install dependencies for cueweb
run: npm install
working-directory: ./cueweb
- name: Run tests in Docker container
run: npm test
working-directory: ./cueweb
test_rest_gateway:
name: Run Rest Gateway Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker build
uses: docker/setup-buildx-action@v2
- name: Build Docker image
run: |
docker build --no-cache -f ./rest_gateway/Dockerfile -t opencue_gateway:latest .
- name: Run Go Unit Tests
run: |
docker run --rm opencue_gateway:latest go test -v ./rest_gateway/opencue_gateway
# test_rest_gateway:
# name: Run Rest Gateway Tests
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# - name: Setup Go
# uses: actions/setup-go@v3
# with:
# go-version: '1.21'
# - name: Initialize go module and install dependencies
# run: |
# cd rest_gateway/opencue_gateway
# go mod init opencue_gateway && go mod tidy
# - name: Install protoc-gen-groc-gateway tool
# run: |
# go install \
# github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest \
# github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest \
# github.com/golang-jwt/jwt/v5@latest \
# google.golang.org/protobuf/cmd/protoc-gen-go@latest \
# google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
# - name: Run rest gateway tests
# run: |
# cd rest_gateway/opencue_gateway
# go test -v ./...

check_changed_files:
name: Check Changed Files
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions rest_gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM centos7.6-go1.21:latest AS build
FROM centos7-go1.21:latest AS build

RUN yum install -y \
git \
Expand Down Expand Up @@ -44,7 +44,7 @@ RUN protoc -I ../proto/ --grpc-gateway_out ./gen/go \
# Build project
RUN go build -o grpc_gateway main.go

FROM centos-7.6.1810:latest
FROM centos-7:latest
COPY --from=build /app/opencue_gateway/grpc_gateway /app/

# Ensure logs folder is created and has correct permissions
Expand Down

0 comments on commit 4174bb4

Please sign in to comment.