Skip to content

Commit

Permalink
Fixing conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosba committed Dec 6, 2024
2 parents 1f486fb + 2126683 commit 9443817
Show file tree
Hide file tree
Showing 351 changed files with 8,209 additions and 4,011 deletions.
559 changes: 559 additions & 0 deletions .github/workflows/ci-test.yaml

Large diffs are not rendered by default.

121 changes: 0 additions & 121 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ Then publish it to npm. Name the module `@meedan/name-of-my-module` (in its
* Copy `test/config.yml.example` to `test/config.yml` and set the configurations
* Copy `config.js.example` to `test/config.js` and set the configurations
* Copy `config.js.example` to `config.js` and set the configurations
* Additional configuration steps to run media similarity tests
- Start Ngrok: `ngrok http 9000`
- Add the public URL generated by ngrok (e.g., https://c239-152-233-241-217.ngrok-free.app) to the `similarity_media_file_url_host` in the Check API config file: https://github.com/meedan/check-api/blob/develop/config/config.yml.example#L47
* Start the test environment in the [check](https://github.com/meedan/check) repository: `docker-compose -f docker-compose.yml -f docker-test.yml up`
* Start the nginx proxy for `web` and `chromedriver` containers
* `docker-compose exec web service nginx start`
Expand Down
69 changes: 38 additions & 31 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,47 +1,53 @@
#!/bin/bash

# set -e
# Running only unit tests
if [[ $TRAVIS_BRANCH != 'develop' && $TRAVIS_BRANCH != 'master' && ! $TRAVIS_COMMIT_MESSAGE =~ \[full\ ci\] && ! $TRAVIS_COMMIT_MESSAGE =~ \[smoke\ tests\] && ! $TRAVIS_COMMIT_MESSAGE =~ \[similarity\ tests\] ]]
if [[ $GITHUB_BRANCH != 'develop' && $GITHUB_BRANCH != 'master' && ! $GITHUB_COMMIT_MESSAGE =~ \[full\ ci\] && ! $GITHUB_COMMIT_MESSAGE =~ \[smoke\ tests\] && ! $GITHUB_COMMIT_MESSAGE =~ \[text\ similarity\ tests\] && ! $GITHUB_COMMIT_MESSAGE =~ \[media\ similarity\ tests\] ]]
then
echo "Running only unit tests"
docker-compose build web
docker-compose -f docker-compose.yml -f docker-test.yml up -d web
docker compose build web
docker compose -f docker-compose.yml -f docker-test.yml up -d web
until curl --silent -I -f --fail http://localhost:3333; do printf .; sleep 1; done
# Running all tests
else
if [[ $TRAVIS_JOB_NAME == 'integration-and-unit-tests' ]]
if [[ $GITHUB_JOB_NAME == 'integration-and-unit-tests' ]]
then
docker-compose build web api api-background pender pender-background
docker-compose -f docker-compose.yml -f docker-test.yml up -d web api api-background pender pender-background chromedriver
docker compose build web api api-background pender pender-background
docker compose -f docker-compose.yml -f docker-test.yml up -d web api api-background pender pender-background chromedriver
else
i=0
NGROK_URL=""
ngrok config add-authtoken $NGROK_AUTH
ngrok config upgrade 2
while [ -z "$NGROK_URL" -a $i -lt 5 ]; do
i=$(($i + 1))
ngrok http 9000 >/dev/null &
until curl --silent -I -f --fail http://localhost:4040; do printf "."; sleep 10; done
curl -I -v http://localhost:4040
curl localhost:4040/api/tunnels > ngrok.json
cat ngrok.json
NGROK_URL=$(grep -Po '"public_url": *\K"[^"]*"' ngrok.json | tail -n1 | sed 's/.\(.*\)/\1/' | sed 's/\(.*\)./\1/')
if [[ $GITHUB_JOB_NAME == 'media-similarity-tests' ]]
then
i=0
NGROK_URL=""
ngrok config add-authtoken $NGROK_AUTH
ngrok config upgrade 2
while [ -z "$NGROK_URL" -a $i -lt 5 ]; do
i=$(($i + 1))
ngrok http 9000 >/dev/null &
until curl --silent -I -f --fail http://localhost:4040; do printf "."; sleep 10; done
curl -I -v http://localhost:4040
curl localhost:4040/api/tunnels > ngrok.json
cat ngrok.json
NGROK_URL=$(grep -Po '"public_url": *\K"[^"]*"' ngrok.json | tail -n1 | sed 's/.\(.*\)/\1/' | sed 's/\(.*\)./\1/')
if [ -z $NGROK_URL ]
then
kill -9 $(pgrep ngrok)
fi
sleep 5
done
if [ -z $NGROK_URL ]
then
kill -9 $(pgrep ngrok)
echo "Not able to connect a Ngrok Tunnel. Please try again!"
exit 1
fi
sleep 5
done
if [ -z $NGROK_URL ]
then
echo "Not able to connect a Ngrok Tunnel. Please try again!"
exit 1
echo "Ngrok tunnel: $NGROK_URL"
sed -i "s~similarity_media_file_url_host: ''~similarity_media_file_url_host: '$NGROK_URL'~g" check-api/config/config.yml
cat check-api/config/config.yml | grep similarity_media_file_url_host
docker compose build web api api-background pender pender-background chromedriver alegre presto-server presto-audio presto-image presto-video
docker compose -f docker-compose.yml -f docker-test.yml up -d web api api-background pender pender-background chromedriver alegre presto-server presto-audio presto-image presto-video
else
docker compose build web api api-background pender pender-background chromedriver alegre presto-server presto-mean-tokens
docker compose -f docker-compose.yml -f docker-test.yml up -d web api api-background pender pender-background chromedriver alegre presto-server presto-mean-tokens
fi
echo "Ngrok tunnel: $NGROK_URL"
sed -i "s~similarity_media_file_url_host: ''~similarity_media_file_url_host: '$NGROK_URL'~g" check-api/config/config.yml
cat check-api/config/config.yml | grep similarity_media_file_url_host
docker-compose build
docker-compose -f docker-compose.yml -f docker-test.yml up -d
until curl --silent -I -f --fail http://localhost:3100; do printf .; sleep 1; done
until curl --silent -I -f --fail http://localhost:8000/ping; do printf .; sleep 1; done
fi
Expand All @@ -56,3 +62,4 @@ else
# docker-compose logs -f presto-audio &
# docker-compose logs -f presto-video &
fi

20 changes: 16 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2.2"
# version: "2.2"
volumes:
elasticsearch:
elasticmq:
Expand Down Expand Up @@ -204,6 +204,21 @@ services:
depends_on:
elasticmq:
condition: service_healthy
presto-mean-tokens:
build: presto
platform: linux/amd64
volumes:
- "./presto:/app"
env_file:
- presto/.env_file
environment:
ROLE: worker
MODEL_NAME: mean_tokens.Model
networks:
- dev
depends_on:
elasticmq:
condition: service_healthy
alegre:
build: alegre
ports:
Expand All @@ -214,9 +229,6 @@ services:
- redis
- elasticsearch
- presto-server
- presto-image
- presto-audio
- presto-video
env_file:
- alegre/.env_file
networks:
Expand Down
4 changes: 3 additions & 1 deletion docker-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "2.2"
networks:
default:
name: dev
Expand Down Expand Up @@ -54,6 +53,9 @@ services:
presto-video:
environment:
BOILERPLATE_ENV: test
presto-mean-tokens:
environment:
BOILERPLATE_ENV: test
web:
environment:
PLATFORM: web
Expand Down
10 changes: 5 additions & 5 deletions localization/react-intl/src/app/components/UploadFile.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
{
"id": "uploadFile.message",
"description": "Message to the user describing the requirements for uploading an image",
"defaultMessage": "<p>Drop an image file here, or click to upload a file</p><p>Max File Size: <strong>{upload_max_size}</strong></p><p>Allowed Extensions: <strong>{upload_extensions}</strong></p><p>Allowed Dimensions: <strong>{upload_min_dimensions} and {upload_max_dimensions} pixels</strong></p>"
"defaultMessage": "<p>Click or drag an image here to upload.</p><p>Max File Size: <strong>{upload_max_size}</strong></p><p>Allowed Extensions: <strong>{upload_extensions}</strong></p><p>Allowed Dimensions: <strong>{upload_min_dimensions} and {upload_max_dimensions} pixels</strong></p>"
},
{
"id": "uploadFile.videoMessage",
"description": "Message to the user describing the requirements for uploading a video",
"defaultMessage": "<p>Drop a video file here, or click to upload a file</p><p>Max File Size: <strong>{video_max_size}</strong></p><p>Allowed Extensions: <strong>{video_extensions}</strong></p>"
"defaultMessage": "<p>Click or drag a video file here to upload.</p><p>Max File Size: <strong>{video_max_size}</strong></p><p>Allowed Extensions: <strong>{video_extensions}</strong></p>"
},
{
"id": "uploadFile.audioMessage",
"description": "Message to the user describing the requirements for uploading an audio file",
"defaultMessage": "<p>Drop an audio file here, or click to upload a file</p><p>Max File Size: <strong>{audio_max_size}</strong></p><p>Allowed Extensions: <strong>{audio_extensions}</strong></p>"
"defaultMessage": "<p>Click or drag an audio file here to upload.</p><p>Max File Size: <strong>{audio_max_size}</strong></p><p>Allowed Extensions: <strong>{audio_extensions}</strong></p>"
},
{
"id": "uploadFile.fileMessage",
"description": "Message to the user describing the requirements for uploading a file using this component",
"defaultMessage": "Drop a file here, or click to upload a file (max size: {file_max_size}, allowed extensions: {file_extensions})"
"defaultMessage": "<>Click or drag a file here to upload.</><p><p>Max File Size: <strong>{file_max_size}</strong></p><p>Allowed Extensions: <strong>{file_extensions}</strong></p>"
},
{
"id": "uploadFile.imageVideoAudioMessage",
"description": "Message to the user describing the requirements for uploading an image, video, or audio file using this component",
"defaultMessage": "<p>Drop a file here, or click to upload a file</p><p>Max File Size: <strong>{file_max_size}</strong></p><p>Allowed Extensions: <strong>{file_extensions}</strong></p>"
"defaultMessage": "<p>Click or drag a file here to upload.</p><p>Max File Size: <strong>{file_max_size}</strong></p><p>Allowed Extensions: <strong>{file_extensions}</strong></p>"
},
{
"id": "uploadFile.invalidExtension",
Expand Down
Loading

0 comments on commit 9443817

Please sign in to comment.