Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Hog committed Jul 15, 2024
1 parent 8ec1225 commit 69dad21
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 21 deletions.
8 changes: 5 additions & 3 deletions tests/nodes/plugins/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM python:3.6-alpine
RUN apk add g++
RUN pip install numpy
FROM python:3
RUN python -m pip install --no-cache-dir numpy
RUN python -m pip install --no-cache-dir psutil
#overwrides entry point otherwise will directly execute python
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]
88 changes: 73 additions & 15 deletions tests/nodes/plugins/dummyNodes.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,80 @@
from meshroom.core.plugin import CondaNode, DockerNode, PipNode, VenvNode
import os

class DummyCondaNode(CondaNode):
commandLine = 'python -c "import numpy as np"'
envFile = os.path.join(os.path.dirname(__file__), 'env.yaml')

import os
from meshroom.core.plugin import PluginNode, EnvType

class DummyConda(PluginNode):

category = 'Dummy'
documentation = ''' '''

envType = EnvType.CONDA
envFile = os.path.join(os.path.dirname(__file__), "env.yaml")

inputs = []
outputs = []

def processChunk(self, chunk):
import numpy as np
print(np.abs(-1))

class DummyDocker(PluginNode):

category = 'Dummy'
documentation = ''' '''

envType = EnvType.DOCKER
envFile = os.path.join(os.path.dirname(__file__), "Dockerfile")

inputs = []
outputs = []

def processChunk(self, chunk):
import numpy as np
print(np.abs(-1))


class DummyVenv(PluginNode):

category = 'Dummy'
documentation = ''' '''

envType = EnvType.VENV
envFile = os.path.join(os.path.dirname(__file__), "requirements.txt")

inputs = []
outputs = []

class DummyDockerNode(DockerNode):
commandLine = 'python -c "import numpy as np"'
envFile = os.path.join(os.path.dirname(__file__), 'Dockerfile')
def processChunk(self, chunk):
import numpy as np
print(np.abs(-1))

class DummyPip(PluginNode):

category = 'Dummy'
documentation = ''' '''

envType = EnvType.PIP
envFile = os.path.join(os.path.dirname(__file__), "requirements.txt")

inputs = []
outputs = []

class DummyPipNode(PipNode):
commandLine = 'python -c "import numpy as np"'
envFile = os.path.join(os.path.dirname(__file__), 'requirements.txt')
def processChunk(self, chunk):
import numpy as np
print(np.abs(-1))

class DummyNone(PluginNode):

category = 'Dummy'
documentation = ''' '''

envType = EnvType.NONE
envFile = None

inputs = []
outputs = []

class DummyVenvNode(VenvNode):
commandLine = 'python -c "import numpy as np"'
envFile = os.path.join(os.path.dirname(__file__), 'requirements.txt')
outputs = []
def processChunk(self, chunk):
import numpy as np
print(np.abs(-1))
6 changes: 4 additions & 2 deletions tests/nodes/plugins/env.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: dummy
channels:
- defaults
- conda-forge
dependencies:
- python>=3.7.6
- numpy
- python
- numpy
- psutil
3 changes: 2 additions & 1 deletion tests/nodes/plugins/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
numpy
numpy
psutil

0 comments on commit 69dad21

Please sign in to comment.