Skip to content

feature/integration-testsdevelop#1263

Open
lbeckman314 wants to merge 10 commits intodevelopfrom
feature/integration-tests
Open

feature/integration-testsdevelop#1263
lbeckman314 wants to merge 10 commits intodevelopfrom
feature/integration-tests

Conversation

@lbeckman314
Copy link
Copy Markdown
Contributor

@lbeckman314 lbeckman314 commented Dec 3, 2025

Overview

This PR adds initial support for integration tests against the Gen3 data platform!

Integration Test Workflow

➜ wget https://raw.githubusercontent.com/uc-cdis/fence/refs/heads/master/.github/workflows/integration_tests.yaml -P .github/workflows
‘.github/workflows/integration_tests.yaml’ saved

Copilot AI review requested due to automatic review settings December 3, 2025 23:46
@lbeckman314 lbeckman314 changed the base branch from main to develop December 3, 2025 23:47
@lbeckman314 lbeckman314 self-assigned this Dec 3, 2025
@lbeckman314 lbeckman314 moved this to In Progress in Funnel Dec 3, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 3, 2025

Deploy Preview for funnel-dev ready!

Name Link
🔨 Latest commit 038b539
🔍 Latest deploy log https://app.netlify.com/projects/funnel-dev/deploys/69377a735ffc1b000856c268
😎 Deploy Preview https://deploy-preview-1263--funnel-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Added commands to initialize and tidy Hugo modules in the website build process.
@lbeckman314 lbeckman314 changed the title developfeature/integration-tests feature/integration-testsdevelop Dec 5, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 30, 2026

Deploy Preview for funnel-dev ready!

Name Link
🔨 Latest commit 97720f4
🔍 Latest deploy log https://app.netlify.com/projects/funnel-dev/deploys/69cb0f02cc89250008153e53
😎 Deploy Preview https://deploy-preview-1263--funnel-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread .github/workflows/gen3-integration-tests.yaml Fixed
Comment thread .github/workflows/gen3-integration-tests.yaml Fixed
Comment thread .github/workflows/gen3-integration-tests.yaml Fixed
Comment on lines +13 to +154
runs-on: ubuntu-latest

steps:
# -----------------
# 1. Cluster Setup
# -----------------

- name: Create Kind cluster
uses: helm/kind-action@v1
with:
cluster_name: funnel-gen3

- name: Install Helm
uses: azure/setup-helm@v4

# ---------------------------
# 2. Install Funnel via Helm
# ---------------------------

- name: Add ohsu Helm repo
run: helm repo add ohsu https://ohsu-comp-bio.github.io/helm-charts && helm repo update

- name: Install Funnel
run: |
# 'standard' is the default StorageClass created by Kind
helm upgrade --install funnel ohsu/funnel \
--set storage.className=standard \
--set storage.provisioner=rancher.io/local-path \
--wait --timeout=60s

- name: Wait for Funnel server
run: kubectl rollout status deployment/funnel-server --timeout=60s

# ----------------------------------
# 3. Install Gen3-Workflow via Helm
# ----------------------------------

- name: Install gen3workflow
run: |
helm upgrade --install gen3workflow ohsu/gen3workflow \
--set funnelUrl=http://funnel:8000 \
--wait --timeout=60s

- name: Wait for gen3workflow
run: kubectl rollout status deployment/gen3workflow --timeout=60s

# -------------------------------------
# 4. Expose services for local testing
# -------------------------------------

- name: Port-forward Funnel
run: kubectl port-forward svc/funnel 8000:8000 &

- name: Port-forward gen3workflow
run: kubectl port-forward svc/gen3workflow 8080:8080 &

# ----------------------------
# 5. Run Nextflow + nf-canary
# ----------------------------

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'

- name: Install Nextflow
run: |
curl -s https://get.nextflow.io | bash
chmod +x nextflow
mkdir -p $HOME/.local/bin
mv nextflow $HOME/.local/bin/
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Clone nf-canary
run: git clone https://github.com/seqeralabs/nf-canary

- name: Configure nf-canary for TES (Funnel)
run: |
cat >> nf-canary/nextflow.config <<'EOF'
plugins {
id 'nf-ga4gh'
}
process.executor = 'tes'
tes.endpoint = 'http://localhost:8000'
EOF

- name: Run nf-canary tests
id: nf_canary
run: |
cd nf-canary
nextflow run main.nf -with-report report.html 2>&1 | tee nextflow.log
echo "exit_code=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT

# -------------------
# 6. Verify K8s Jobs
# -------------------

- name: Verify Kubernetes jobs completed
run: |
echo "=== All jobs in default namespace ==="
kubectl get jobs -o wide

FAILED=$(kubectl get jobs \
--field-selector=status.failed!=0 \
-o jsonpath='{.items[*].metadata.name}' 2>/dev/null || true)

if [ -n "$FAILED" ]; then
echo "Failed jobs: $FAILED"
for JOB in $FAILED; do
echo "--- Logs for $JOB ---"
kubectl logs job/$JOB --tail=50 || true
done
exit 1
fi

SUCCEEDED=$(kubectl get jobs \
--field-selector=status.successful!=0 \
-o jsonpath='{.items[*].metadata.name}' 2>/dev/null || true)

if [ -z "$SUCCEEDED" ]; then
echo "No jobs completed successfully — did any tasks run?"
kubectl describe jobs || true
exit 1
fi

echo "All Kubernetes jobs completed successfully: $SUCCEEDED"

# ------------------------------
# 7. Upload test logs + reports
# ------------------------------

- name: Upload Nextflow logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nextflow-logs
path: |
nf-canary/nextflow.log
nf-canary/report.html
nf-canary/.nextflow.log
if-no-files-found: ignore

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

In general, the fix is to explicitly declare a permissions block that grants only the minimal required scopes to GITHUB_TOKEN. When a workflow doesn’t need to modify repository contents, issues, or pull requests, contents: read is a safe baseline. Additional scopes (like actions: read or checks: read) are only needed if the workflow explicitly relies on them.

For this workflow, none of the steps modify or query GitHub resources beyond what contents: read covers, and artifact upload does not require extra token scopes. The minimal, sensible fix is to add a root-level permissions block (so it applies to all jobs) near the top of .github/workflows/gen3-integration-tests.yaml, for example immediately after name: Gen3 Integration Tests, setting contents: read. No other code changes or imports are needed, and functionality remains unchanged because the job does not use any write permissions today.

Concretely:

  • Edit .github/workflows/gen3-integration-tests.yaml.
  • Insert:
    permissions:
      contents: read
    between the existing name: line and the on: block.
  • Leave all job and step definitions as they are.
Suggested changeset 1
.github/workflows/gen3-integration-tests.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/gen3-integration-tests.yaml b/.github/workflows/gen3-integration-tests.yaml
--- a/.github/workflows/gen3-integration-tests.yaml
+++ b/.github/workflows/gen3-integration-tests.yaml
@@ -1,4 +1,7 @@
 name: Gen3 Integration Tests
+
+permissions:
+  contents: read
  
 on:
   push:
EOF
@@ -1,4 +1,7 @@
name: Gen3 Integration Tests

permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@paulineribeyre
Copy link
Copy Markdown
Collaborator

This is being done in #1402 instead

@paulineribeyre
Copy link
Copy Markdown
Collaborator

Replaced by #1404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants