Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#9)create r container for test #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 0 additions & 12 deletions DockerfileTest

This file was deleted.

12 changes: 2 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
notebook:
container_name: notebook
build: .
image: msr2021replication
ports:
- 8888:8888
- 40000:40000
Expand All @@ -15,13 +16,4 @@ services:
- ./output/:/app/output
- ./output/so_results:/app/output/so_results
- ./extra_stop_words:/app/extra_stop_words

notebook-test:
container_name: notebook-test
build:
context: .
dockerfile: DockerfileTest
volumes:
- './notebook/:/home/notebook'
command:
bash -c "pytest -vv --cov"
- ./tests:/app/tests
16 changes: 16 additions & 0 deletions dockerfiler
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM rocker/r-base:latest

# Instalar pacotes R necessários
RUN R -e "install.packages(c('ggplot2', 'reshape2', 'nortest'), repos='http://cran.rstudio.com/')"
RUN apt-get update && apt-get install -y libmpfr-dev
RUN R -e "install.packages('PMCMRplus', repos='http://cran.rstudio.com/')"

# Copiar o código R e a pasta data para dentro do contêiner
COPY notebook/tests.r /app/tests.r
COPY data /app/data

# Diretório de trabalho dentro do contêiner
WORKDIR /app

# Comando para executar o script R
CMD ["Rscript", "/app/tests.r"]
3 changes: 3 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ process:
results:
python3 notebook/manage_results.py
clear

test:
docker exec notebook pytest tests/unit/ -vv
5 changes: 4 additions & 1 deletion notebook/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
nltk
pandas==1.5
pandas==1.5
pytest==7.0.1
pytest-cov==3.0.0
coverage==6.4.4
6 changes: 2 additions & 4 deletions notebook/tests.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ library(ggplot2)
library(reshape2)
library(nortest)

setwd("/Users/gianlucascoccia/Desktop/MSR2021/analysis/notebook")

# Load data
so = read.csv("../data/processed/so_test_data.csv", header = TRUE)
gh = read.csv("../data/processed/gh_test_data.csv", header = TRUE)
so = read.csv("/app/data/processed/so_test_data.csv", header = TRUE)
gh = read.csv("/app/data/processed/gh_test_data.csv", header = TRUE)

# Extract relevant columns from dataframes
so_data = matrix(c(so$time_topic_2, so$time_topic_5, so$time_topic_1, so$time_topic_11, so$time_topic_4, so$time_topic_13,
Expand Down
3 changes: 0 additions & 3 deletions tests/requirements-tests.txt

This file was deleted.

File renamed without changes.