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
6 changes: 3 additions & 3 deletions .github/actions/bbsim-tests/EXTERNAL-USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ When the action runs, it automatically checks out these repositories into the ru

1. **voltha-system-tests** - Contains the Robot Framework test suites
2. **voltha-helm-charts** - Contains Helm charts for deployment (if using patches or release branches)
3. **gerrit-project** (optional) - If testing a specific component patch
3. **project** (optional) - If testing a specific component patch

The calling repository is **not** automatically checked out. If you need files from your repository, add a checkout step:

Expand Down Expand Up @@ -125,7 +125,7 @@ When the action runs, the file system looks like this:
├── <calling-repo-name>/ (only if explicitly checked out)
├── voltha-system-tests/ (checked out by action)
├── voltha-helm-charts/ (checked out by action, if needed)
├── <gerrit-project>/ (checked out by action, if specified)
├── <project>/ (checked out by action, if specified)
├── bin/ (created by action for tools)
├── logs/ (created by action for test results)
└── tmp/
Expand Down Expand Up @@ -173,7 +173,7 @@ All test-specific variables are passed to the execution script via environment.
**Solutions**:
1. This should not happen - the action checks out the repository automatically
2. If it does occur, check the action's checkout step logs
3. Verify network connectivity to GitHub/Gerrit
3. Verify network connectivity to GitHub

## Version Pinning

Expand Down
26 changes: 13 additions & 13 deletions .github/actions/bbsim-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The action performs the following steps:

1. **Setup Environment**: Installs all required dependencies (kubectl, helm, kind, kail, voltctl)
2. **Checkout Repositories**: Clones voltha-system-tests and voltha-helm-charts
3. **Build Components**: Optionally builds VOLTHA components from Gerrit patches
3. **Build Components**: Optionally builds VOLTHA components from a project patch
4. **Create Kubernetes Cluster**: Sets up a kind cluster for testing
5. **Deploy Infrastructure**: Deploys VOLTHA, ONOS, and BBSim instances
6. **Run Tests**: Executes Robot Framework test suites
Expand All @@ -27,8 +27,8 @@ The action performs the following steps:

### Optional Inputs

- **`gerrit-project`**: Gerrit project name if building a patch (default: `""`)
- **`gerrit-refspec`**: Gerrit refspec if building a patch (default: `""`)
- **`project`**: Project (repository) name if building a patch (default: `""`)
- **`refspec`**: Refspec of the change if building a patch (default: `""`)
- **`extra-helm-flags`**: Additional Helm flags for deployment (default: `""`)
- **`log-level`**: Log level for VOLTHA components: DEBUG, INFO, WARN, ERROR (default: `"WARN"`)
- **`timeout`**: Timeout in minutes for the entire action (default: `"240"`)
Expand Down Expand Up @@ -179,20 +179,20 @@ jobs:
path: logs/
```

### Testing a Gerrit Patch
### Testing a Patch

```yaml
name: Test Gerrit Patch
name: Test Patch

on:
workflow_dispatch:
inputs:
gerrit_project:
description: 'Gerrit project name'
project:
description: 'Project (repository) name'
required: true
type: string
gerrit_refspec:
description: 'Gerrit refspec'
refspec:
description: 'Refspec of the change'
required: true
type: string

Expand All @@ -204,8 +204,8 @@ jobs:
uses: opencord/shared-workflows/.github/actions/bbsim-tests@master
with:
branch: master
gerrit-project: ${{ inputs.gerrit_project }}
gerrit-refspec: ${{ inputs.gerrit_refspec }}
project: ${{ inputs.project }}
refspec: ${{ inputs.refspec }}
test-targets: |
- target: sanity-single-kind
workflow: dt
Expand Down Expand Up @@ -334,8 +334,8 @@ This action replaces the Jenkins pipeline `bbsim-tests.groovy`. Key differences:
|------------------|---------------------|
| `branch` | `branch` |
| `testTargets` | `test-targets` |
| `gerritProject` | `gerrit-project` |
| `gerritRefspec` | `gerrit-refspec` |
| `gerritProject` | `project` |
| `gerritRefspec` | `refspec` |
| `extraHelmFlags` | `extra-helm-flags` |
| `logLevel` | `log-level` |
| `timeout` | `timeout` |
Expand Down
44 changes: 22 additions & 22 deletions .github/actions/bbsim-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ inputs:
test-targets:
description: "YAML string defining test targets to run"
required: true
gerrit-project:
description: "Gerrit project name if building a patch"
project:
description: "Project (repository) name if building a patch"
required: false
default: ""
gerrit-refspec:
description: "Gerrit refspec if building a patch"
refspec:
description: "Refspec of the change if building a patch"
required: false
default: ""
extra-helm-flags:
Expand Down Expand Up @@ -163,7 +163,7 @@ runs:
shell: bash
run: |
echo "Installing voltctl..."
if [ "${{ inputs.gerrit-project }}" != "voltctl" ]; then
if [ "${{ inputs.project }}" != "voltctl" ]; then
if [ ! -f "$GITHUB_WORKSPACE/bin/voltctl" ]; then
VOLTCTL_VERSION="1.8.45"
curl -Lo "$GITHUB_WORKSPACE/bin/voltctl" \
Expand All @@ -190,28 +190,28 @@ runs:
path: voltha-helm-charts

# -----------------------------------------------------------------------
# Checkout and build gerrit project if specified
# Checkout and build project if specified
# -----------------------------------------------------------------------
- name: Checkout gerrit project
if: inputs.gerrit-project != ''
- name: Checkout project
if: inputs.project != ''
uses: actions/checkout@v4
with:
repository: opencord/${{ inputs.gerrit-project }}
ref: ${{ inputs.gerrit-refspec }}
path: ${{ inputs.gerrit-project }}
repository: opencord/${{ inputs.project }}
ref: ${{ inputs.refspec }}
path: ${{ inputs.project }}

- name: Build gerrit project
if: inputs.gerrit-project != ''
- name: Build project
if: inputs.project != ''
shell: bash
working-directory: ${{ inputs.gerrit-project }}
working-directory: ${{ inputs.project }}
run: |
echo "Building ${{ inputs.gerrit-project }}..."
echo "Building ${{ inputs.project }}..."
if [ -f "Makefile" ]; then
make docker-build
fi

- name: Build and install voltctl from source
if: inputs.gerrit-project == 'voltctl'
if: inputs.project == 'voltctl'
shell: bash
working-directory: voltctl
run: |
Expand Down Expand Up @@ -260,11 +260,11 @@ runs:
# Load images to kind if building a component
# -----------------------------------------------------------------------
- name: Load images to kind
if: inputs.gerrit-project != '' && inputs.gerrit-project != 'voltctl'
if: inputs.project != '' && inputs.project != 'voltctl'
shell: bash
run: |
echo "Loading images to kind cluster..."
PROJECT="${{ inputs.gerrit-project }}"
PROJECT="${{ inputs.project }}"
IMAGE_NAME="${PROJECT//-/_}"

# Find the built image
Expand Down Expand Up @@ -322,7 +322,7 @@ runs:
ENABLE_MAC_LEARNING="${ENABLE_MAC_LEARNING:-false}"
EXTRA_ROBOT_ARGS="${EXTRA_ROBOT_ARGS:-}"
BRANCH="${BRANCH:-master}"
GERRIT_PROJECT="${GERRIT_PROJECT:-}"
PROJECT="${PROJECT:-}"

# Helper functions
banner() {
Expand Down Expand Up @@ -403,9 +403,9 @@ runs:
HELM_FLAGS="$HELM_FLAGS $TEST_FLAGS"
fi

if [ -n "$GERRIT_PROJECT" ] && [ "$GERRIT_PROJECT" != "voltctl" ]; then
if [ -n "$PROJECT" ] && [ "$PROJECT" != "voltctl" ]; then
IMAGE_TAG="citest"
case "$GERRIT_PROJECT" in
case "$PROJECT" in
voltha-go)
HELM_FLAGS="$HELM_FLAGS --set voltha.image.tag=$IMAGE_TAG"
;;
Expand Down Expand Up @@ -601,7 +601,7 @@ runs:
env['ENABLE_MAC_LEARNING'] = "${{ inputs.enable-mac-learning }}"
env['EXTRA_ROBOT_ARGS'] = "${{ inputs.extra-robot-args }}"
env['BRANCH'] = "${{ inputs.branch }}"
env['GERRIT_PROJECT'] = "${{ inputs.gerrit-project }}"
env['PROJECT'] = "${{ inputs.project }}"

# Create logs directory for this test
os.makedirs(env['LOGS_DIR'], exist_ok=True)
Expand Down
12 changes: 6 additions & 6 deletions .github/actions/bbsim-tests/example-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,17 @@ jobs:
retention-days: 30

# -----------------------------------------------------------------------
# Job: Test Gerrit Patch
# Job: Test Patch
# -----------------------------------------------------------------------
test-patch:
name: Test Gerrit Patch
name: Test Patch
runs-on: ubuntu-latest
timeout-minutes: 240
# Only run when triggered manually with patch information
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.gerrit_project != '' &&
github.event.inputs.gerrit_refspec != ''
github.event.inputs.project != '' &&
github.event.inputs.refspec != ''

steps:
- name: Free up disk space
Expand All @@ -295,8 +295,8 @@ jobs:
uses: opencord/shared-workflows/.github/actions/bbsim-tests@main
with:
branch: ${{ github.event.inputs.branch || 'master' }}
gerrit-project: ${{ github.event.inputs.gerrit_project }}
gerrit-refspec: ${{ github.event.inputs.gerrit_refspec }}
project: ${{ github.event.inputs.project }}
refspec: ${{ github.event.inputs.refspec }}
log-level: DEBUG
test-targets: |
- target: sanity-single-kind
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sanity-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ jobs:
with:
branch: ${{ inputs.BRANCH }}
test-targets: ${{ inputs.TEST_TARGETS }}
gerrit-project: ${{ inputs.PROJECT }}
gerrit-refspec: ${{ inputs.REFSPEC }}
project: ${{ inputs.PROJECT }}
refspec: ${{ inputs.REFSPEC }}
extra-helm-flags: ${{ inputs.EXTRA_HELM_FLAGS }}
log-level: ${{ inputs.LOG_LEVEL }}
timeout: ${{ inputs.TIMEOUT }}
Expand Down