Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau authored Dec 16, 2024
2 parents f773220 + 0540c01 commit dc75210
Show file tree
Hide file tree
Showing 362 changed files with 8,812 additions and 475 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
'no-case-declarations': 'warn',
'prefer-regex-literals': 'warn',
'react/prop-types': 'warn',
'react/jsx-curly-brace-presence': 'warn',

// Enforce notification hooks
'no-restricted-imports': [
Expand Down
8 changes: 5 additions & 3 deletions .github/actions/odd-resource-analysis/action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ async function run() {
try {
const mixpanelUser = core.getInput('mixpanel-user', { required: true })
const mixpanelSecret = core.getInput('mixpanel-secret', { required: true })
const mixpanelProjectId = core.getInput('mixpanel-project-id', {
required: true,
})
const mixpanelProjectId = parseInt(
core.getInput('mixpanel-project-id', {
required: true,
})
)
const previousVersionCount = parseInt(
core.getInput('previous-version-count') || '2'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function getMixpanelResourceMonitorDataFor({
where,
}) {
const params = new URLSearchParams({
project_id: parseInt(projectId),
project_id: projectId,
from_date: fromDate,
to_date: toDate,
event: '["resourceMonitorReport"]',
Expand Down
56 changes: 54 additions & 2 deletions .github/workflows/api-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ jobs:
strategy:
matrix:
os: ['windows-2022', 'ubuntu-22.04', 'macos-latest']
# TODO(mc, 2022-02-24): expand this matrix to 3.8 and 3.9,
# preferably in a nightly cronjob on edge or something
python: ['3.10']
with-ot-hardware: ['true', 'false']
exclude:
Expand Down Expand Up @@ -128,6 +126,60 @@ jobs:
files: ./api/coverage.xml
flags: api

test-package:
name: 'installed package tests on ${{ matrix.os }}'
timeout-minutes: 5
strategy:
matrix:
os: ['ubuntu-22.04', 'macos-latest', 'windows-2022']
runs-on: '${{ matrix.os }}'
steps:
- uses: 'actions/checkout@v4'
- name: 'Fix actions/checkout odd handling of tags'
if: startsWith(github.ref, 'refs/tags')
run: |
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
git checkout ${{ github.ref }}
- uses: 'actions/setup-python@v4'
with:
python-version: '3.10'
- name: Set up package-testing
id: setup
if: ${{ matrix.os != 'windows-2022' }}
working-directory: package-testing
shell: bash
run: make setup
- name: Set up package-testing (Windows)
id: setup-windows
if: ${{ matrix.os == 'windows-2022' }}
working-directory: package-testing
shell: pwsh
run: make setup-windows
- name: Run the tests
if: ${{ matrix.os != 'windows-2022' }}
shell: bash
id: test
working-directory: package-testing
run: make test
- name: Run the tests (Windows)
shell: pwsh
id: test-windows
working-directory: package-testing
run: make test-windows
- name: Save the test results
if: ${{ always() && steps.setup.outcome == 'success' || steps.setup-windows.outcome == 'success' }}
id: results
uses: actions/upload-artifact@v4
with:
name: package-test-results-${{ matrix.os }}
path: package-testing/results
- name: Set job summary
if: ${{ always() }}
run: |
echo "## Opentrons Package Test Results ${{matrix.os}}" >> $GITHUB_STEP_SUMMARY
echo "### Test Outcome: Unixy ${{ steps.test.outcome }} Windows: ${{ steps.test-windows.outcome }}" >> $GITHUB_STEP_SUMMARY
echo "[Download the test results artifact](${{steps.results.outputs.artifact-url}})" >> $GITHUB_STEP_SUMMARY
deploy:
name: 'deploy opentrons package'
needs: [test]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/odd-memory-usage-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
with:
mixpanel-user: ${{ secrets.MIXPANEL_INGEST_USER }}
mixpanel-secret: ${{ secrets.MIXPANEL_INGEST_SECRET }}
mixpanel-project-id: ${{ secrets.OT_APP_MIXPANEL_ID }}
mixpanel-project-id: ${{ secrets.OT_MIXPANEL_PROJECT_ID }}
previous-version-count: '2'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,5 @@ opentrons-robot-app.tar.gz
mock_dir
.npm-cache/
.eslintcache

package-testing/results
46 changes: 21 additions & 25 deletions abr-testing/abr_testing/tools/make_push.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Push one or more folders to one or more robots."""
import subprocess
import multiprocessing
import json
from typing import List
from multiprocessing import Process, Queue

global folders
# Opentrons folders that can be pushed to robot
Expand All @@ -13,20 +14,22 @@
]


def push_subroutine(cmd: str) -> None:
def push_subroutine(cmd: str, queue: Queue) -> None:
"""Pushes specified folder to specified robot."""
try:
subprocess.run(cmd)
queue.put(f"{cmd}: SUCCESS!\n")
except Exception:
print("failed to push folder")
raise
queue.put(f"{cmd}: FAILED\n")


def main(folder_to_push: str, robot_to_push: str) -> int:
"""Main process!"""
cmd = "make -C {folder} push-ot3 host={ip}"
robot_ip_path = ""
push_cmd = ""
processes: List[Process] = []
queue: Queue = Queue()
folder_int = int(folder_to_push)
if folders[folder_int].lower() == "abr-testing + hardware-testing":
if robot_to_push.lower() == "all":
Expand All @@ -41,20 +44,16 @@ def main(folder_to_push: str, robot_to_push: str) -> int:
for folder_name in folders[:-2]:
# Push abr-testing and hardware-testing folders to all robots
for robot in robot_ips:
print_proc = multiprocessing.Process(
target=print, args=(f"Pushing {folder_name} to {robot}!\n\n",)
)
print_proc.start()
print_proc.join()
push_cmd = cmd.format(folder=folder_name, ip=robot)
process = multiprocessing.Process(
target=push_subroutine, args=(push_cmd,)
process = Process(
target=push_subroutine,
args=(
push_cmd,
queue,
),
)
process.start()
process.join()
print_proc = multiprocessing.Process(target=print, args=("Done!\n\n",))
print_proc.start()
print_proc.join()
processes.append(process)
else:

if folder_int == (len(folders) - 1):
Expand All @@ -72,18 +71,15 @@ def main(folder_to_push: str, robot_to_push: str) -> int:

# Push folder to robots
for robot in robot_ips:
print_proc = multiprocessing.Process(
target=print, args=(f"Pushing {folder_name} to {robot}!\n\n",)
)
print_proc.start()
print_proc.join()
push_cmd = cmd.format(folder=folder_name, ip=robot)
process = multiprocessing.Process(target=push_subroutine, args=(push_cmd,))
process = Process(target=push_subroutine, args=(push_cmd, queue))
process.start()
process.join()
print_proc = multiprocessing.Process(target=print, args=("Done!\n\n",))
print_proc.start()
print_proc.join()
processes.append(process)

for process in processes:
process.join()
result = queue.get()
print(f"\n{result}")
return 0


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [],
"config": {
"apiVersion": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [
{
"commandType": "home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commandAnnotations": [],
"commands": [],
"config": {
"apiVersion": [
Expand Down
Loading

0 comments on commit dc75210

Please sign in to comment.