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

Epic/cv2 5050 text vectorization via presto #2112

Open
wants to merge 74 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
f364986
[full ci] CV2-4126 Run Video Integration Tests
DGaffney Apr 15, 2024
a804fe6
[full ci] add redis as dependency on presto
DGaffney Jun 26, 2024
b0e48ef
[full ci] integration tests on presto integration for text
DGaffney Sep 16, 2024
22efc19
[full ci] Update docker-compose.yml
DGaffney Sep 16, 2024
20a4f12
[full ci] test again after updates
DGaffney Sep 16, 2024
8d39278
[full ci] test again after updates
DGaffney Sep 16, 2024
896eac8
[full ci] CV2-4126 Run Video Integration Tests
DGaffney Apr 15, 2024
2160c4a
[full ci] add redis as dependency on presto
DGaffney Jun 26, 2024
fcad225
Merge branch 'develop' into epic/cv2-5050-text-vectorization-via-presto
DGaffney Sep 18, 2024
d777337
[full ci] test again after updates
DGaffney Sep 18, 2024
dde58ee
Update docker-compose.yml
DGaffney Sep 18, 2024
fac1e00
[full ci] test again after updates
DGaffney Sep 18, 2024
5c66e0c
[full ci] test again after updates
DGaffney Sep 18, 2024
cdcedc6
[full ci] relax mean-tokens constraint for now
DGaffney Sep 19, 2024
f1bd1b0
[full ci] test again after updates
DGaffney Sep 19, 2024
4185012
[full ci] comment out other tests and watch alegre
DGaffney Sep 20, 2024
dd6a203
Trying to make the test more robust
caiosba Sep 24, 2024
b7a4a3a
Merge branch 'develop' into epic/cv2-5050-text-vectorization-via-presto
caiosba Sep 24, 2024
33c6fe8
More robust test, take 2
caiosba Sep 24, 2024
042dbe7
[similarity tests]
caiosba Sep 24, 2024
e26a6b6
[similarity tests]
caiosba Sep 24, 2024
46b2428
[similarity tests]
caiosba Sep 24, 2024
5a9d8ac
[similarity tests]
caiosba Sep 24, 2024
e469a22
[similarity tests]
caiosba Sep 24, 2024
f59e2b8
Commenting Presto containers just to see if it makes any difference […
caiosba Sep 24, 2024
a2940a5
Commenting Presto containers just to see if it makes any difference, …
caiosba Sep 24, 2024
0aa2987
Commenting Presto containers just to see if it makes any difference, …
caiosba Sep 24, 2024
3d0e2de
Commenting Presto containers just to see if it makes any difference, …
caiosba Sep 25, 2024
29b0ed2
Commenting Presto containers just to see if it makes any difference, …
caiosba Sep 25, 2024
93d1ab0
Commenting Presto containers just to see if it makes any difference, …
caiosba Sep 25, 2024
0d88a0a
Not even creating an item, just to see if there is any Alegre activit…
caiosba Sep 25, 2024
34321f4
Fixing lint issue [similarity tests]
caiosba Sep 25, 2024
ea3c625
Debugging claim creation [similarity tests]
caiosba Sep 25, 2024
9934bc1
Rewriting in a way that we can set custom timeout values [similarity …
caiosba Sep 25, 2024
e95c762
Enabling Check API logs as well [similarity tests]
caiosba Sep 25, 2024
253bd21
Enabling Check API logs as well, take 2 [similarity tests]
caiosba Sep 25, 2024
9337490
[similarity tests]
caiosba Sep 25, 2024
69ae18a
Time to run the test! [similarity tests]
caiosba Sep 26, 2024
066d69c
Time to run the test! Take 2! [similarity tests]
caiosba Sep 26, 2024
83e691e
Time to run the test! Take 3! [similarity tests]
caiosba Sep 26, 2024
77408de
Debug... [similarity tests]
caiosba Sep 26, 2024
03b12d4
Debug 2... [similarity tests]
caiosba Sep 26, 2024
4649dab
Debug 3... [similarity tests]
caiosba Sep 26, 2024
483a9e2
Debug 4... [similarity tests]
caiosba Sep 26, 2024
c941f67
Debug 5... [similarity tests]
caiosba Sep 27, 2024
6992b7f
Debug 6... [similarity tests]
caiosba Sep 27, 2024
95062c2
Debug 6... [similarity tests]
caiosba Sep 27, 2024
77e45f2
Debug 7... [similarity tests]
caiosba Sep 27, 2024
c842ac4
Debug 8... [similarity tests]
caiosba Sep 27, 2024
712d45c
Debug 9... [similarity tests]
caiosba Sep 27, 2024
96b37c9
Debug 9... [similarity tests]
caiosba Sep 27, 2024
1625047
Debug 10... [similarity tests]
caiosba Sep 27, 2024
68d983d
Debug 11... [similarity tests]
caiosba Sep 27, 2024
8613ebc
Debug 12... [similarity tests]
caiosba Sep 27, 2024
b23170d
Debug 13... [similarity tests]
caiosba Sep 27, 2024
87c62a8
Debug 14... [similarity tests]
caiosba Sep 28, 2024
ae2a2b9
Debug 15... [similarity tests]
caiosba Sep 28, 2024
e32eb9d
Debug 16... [similarity tests]
caiosba Sep 28, 2024
a8427ac
Debug 17... [similarity tests]
caiosba Sep 28, 2024
6202bd9
Fixing, take 1... [similarity tests]
caiosba Sep 28, 2024
0b44b6d
Run all tests and run Presto [similarity tests]
caiosba Sep 29, 2024
a55973f
Run all tests and run Presto, take 2 [similarity tests]
caiosba Sep 29, 2024
c15ef8e
Splitting CI between media and text
DGaffney Oct 12, 2024
d648b30
Merge branch 'develop' into epic/cv2-5050-text-vectorization-via-presto
caiosba Oct 12, 2024
baa19b1
[full ci]
caiosba Oct 12, 2024
719d6cd
[full ci] CV2-4126 Run Video Integration Tests
DGaffney Apr 15, 2024
08625e4
fix
DGaffney Oct 12, 2024
6950980
[full ci] readd vector tests
DGaffney Oct 12, 2024
f28c976
[full ci] run integration suite
DGaffney Oct 14, 2024
103f72b
[full ci] remove redis which snuck in somehow
DGaffney Oct 14, 2024
8c73fba
[full ci] remove redis which snuck in somehow
DGaffney Oct 14, 2024
1be52af
remove whitespace
DGaffney Oct 14, 2024
f616f04
[full ci] run integration suite
DGaffney Oct 14, 2024
123b628
add multiple vector model search
DGaffney Oct 21, 2024
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
22 changes: 19 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,24 @@ jobs:
-e TEST_RETRY_COUNT=3
web npm run tests
- stage: tests
name: similarity-tests
if: branch = develop OR branch = master OR commit_message =~ /\[full ci\]/ OR commit_message =~ /\[similarity tests\]/
name: media-similarity-tests
if: branch = develop OR branch = master OR commit_message =~ /\[full ci\]/ OR commit_message =~ /\[media similarity tests\]/
script:
- docker-compose exec web service nginx start
- docker-compose -f docker-compose.yml -f docker-test.yml exec chromedriver service nginx start
- docker-compose exec
-e IMGUR_CLIENT_ID=$IMGUR_CLIENT_ID
-e TRAVIS_JOB_NAME=$TRAVIS_JOB_NAME
-e TRAVIS_BRANCH=$TRAVIS_BRANCH
-e AWS_ENDPOINT=$AWS_ENDPOINT
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
-e AWS_REGION=$AWS_REGION
-e TEST_RETRY_COUNT=3
web npm run tests
- stage: tests
name: text-similarity-tests
if: branch = develop OR branch = master OR commit_message =~ /\[full ci\]/ OR commit_message =~ /\[text similarity tests\]/
script:
- docker-compose exec web service nginx start
- docker-compose -f docker-compose.yml -f docker-test.yml exec chromedriver service nginx start
Expand All @@ -99,7 +115,7 @@ jobs:
web npm run tests
- stage: tests
name: unit-tests
if: branch != develop AND branch != master AND NOT commit_message =~ /\[full ci\]/ AND NOT commit_message =~ /\[smoke tests\]/ AND NOT commit_message =~ /\[similarity tests\]/
if: branch != develop AND branch != master AND NOT commit_message =~ /\[full ci\]/ AND NOT commit_message =~ /\[smoke tests\]/ AND NOT commit_message =~ /\[media similarity tests\]/ AND NOT commit_message =~ /\[text similarity tests\]/
script:
- docker-compose exec -e TRAVIS_JOB_NAME=$TRAVIS_JOB_NAME web npm run tests
after_script:
Expand Down
56 changes: 31 additions & 25 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# 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 [[ $TRAVIS_BRANCH != 'develop' && $TRAVIS_BRANCH != 'master' && ! $TRAVIS_COMMIT_MESSAGE =~ \[full\ ci\] && ! $TRAVIS_COMMIT_MESSAGE =~ \[smoke\ tests\] && ! $TRAVIS_COMMIT_MESSAGE =~ \[text\ similarity\ tests\] && ! $TRAVIS_COMMIT_MESSAGE =~ \[media\ similarity\ tests\] ]]
then
echo "Running only unit tests"
docker-compose build web
Expand All @@ -14,34 +14,40 @@ else
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 [[ $TRAVIS_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 Down
22 changes: 17 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ services:
networks:
- dev
depends_on:
elasticmq:
condition: service_healthy
- elasticmq
- redis
presto-video:
build: presto
platform: linux/amd64
Expand All @@ -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
3 changes: 3 additions & 0 deletions docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ services:
presto-video:
environment:
BOILERPLATE_ENV: test
presto-mean-tokens:
environment:
BOILERPLATE_ENV: test
web:
environment:
PLATFORM: web
Expand Down
1 change: 0 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ http {
proxy_set_header X-Forwarded-Host $server_name;
}
}

}
22 changes: 22 additions & 0 deletions test/parallel-media-similarity-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

echo 'Starting tests...'

FAIL=0

bundle exec rspec --tag bin8 spec/integration_spec.rb &

for job in `jobs -p`
do
echo $job
wait $job || let "FAIL+=1"
done

echo $FAIL

if [ "$FAIL" == "0" ];
then
exit 0
else
exit 1
fi
8 changes: 6 additions & 2 deletions test/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ elif [[ $TRAVIS_JOB_NAME == 'unit-tests' ]]
then
npm run test:unit || exit 1
./../scripts/uncovered-files
else
./parallel-similarity-test.sh
elif [[ $TRAVIS_JOB_NAME == 'media-similarity-tests' ]]
then
./parallel-media-similarity-test.sh
elif [[ $TRAVIS_JOB_NAME == 'text-similarity-tests' ]]
then
./parallel-text-similarity-test.sh
fi
20 changes: 17 additions & 3 deletions test/spec/api_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,21 @@ def request_api(path, params)
require 'net/http'
uri = URI(api_path + path)
uri.query = URI.encode_www_form(params)
response = Net::HTTP.get_response(uri)
ret = nil
response = nil
begin
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == 'https')
http.open_timeout = 120 # Time to open the connection
http.read_timeout = 120 # Time to wait for the response
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
ret = OpenStruct.new JSON.parse(response.body)['data']
puts "Successful response when calling #{path} with params '#{params.inspect}': #{response.body}"
rescue Net::ReadTimeout
puts "Timeout when calling #{path} with params '#{params.inspect}'"
rescue StandardError
print "Failed to parse body of response for endpoint `#{path}`:\n#{response.inspect}\n" unless response.class <= Net::HTTPSuccess
puts "Failed to parse body of response for endpoint #{path}: Response: #{response.inspect} Body: #{response.body}" unless response.class <= Net::HTTPSuccess
end
ret
end
Expand Down Expand Up @@ -47,8 +56,10 @@ def api_create_team_and_bot(params = {})
user = params[:user] || api_register_and_login_with_email
@slug = "test-team-#{Time.now.to_i}-#{rand(10_000).to_i}"
team = request_api 'team', { name: "Test Team #{Time.now.to_i}", slug: @slug, email: user.email }
api_install_bot(params[:bot], team[:slug], params[:score]) if params[:bot]
sleep 5
puts "team created: #{team.inspect}"
api_install_bot(params[:bot], team[:slug], params[:score]) if params[:bot]
sleep 10
{ user: user, team: team }
end

Expand Down Expand Up @@ -161,9 +172,12 @@ def api_suggest_similarity_between_items(team_id, source, target)
end

def api_install_bot(bot, slug = nil, settings = {})
settings ||= { min_es_score: 0 }
url = @driver.current_url.to_s
team_slug = slug || url.match(%r{^https?://[^/]+/([^/]+)})[1]
puts "Installing bot with settings: #{settings.inspect}"
request_api 'install_bot', { bot: bot, slug: team_slug, settings: settings.to_json }
sleep 2
@driver.navigate.to url
end

Expand Down
2 changes: 1 addition & 1 deletion test/spec/app_spec_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def create_media(url, wait_for_creation = true)

def create_image(file)
# show the side navigation for workspace tipline
wait_for_selector('#side-navigation__tipline-toggle').click
@driver.navigate.to "#{@config['self_url']}/#{@slug}/all-items"
wait_for_selector('.projects-list')
wait_for_selector('.projects-list__all-items').click
wait_for_selector('#create-media-button__open-button').click
Expand Down
65 changes: 47 additions & 18 deletions test/spec/similarity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,48 @@

it 'should identify texts as similar', bin7: true do
data = api_create_team_and_bot(bot: 'alegre', score: { min_es_score: 0 })
pm1 = api_create_claim(data: data, quote: 'Lorem Ipsum is used to generate dummy texts of the printing and TI industry. Lorem Ipsum has been used by the industry for text generation ever since the 1502s.')
sleep 60 # wait for the items to be indexed in the Elasticsearch
api_create_claim(data: data, quote: 'Lorem Ipsum is used to generate dummy texts of the printing and TI industry. Lorem Ipsum has been used by the industry for text generation ever since the 1501s.')
sleep 60 # wait for the items to be indexed in the Elasticsearch
@driver.navigate.to "#{@config['self_url']}/#{data[:team].slug}/media/#{pm1.id}"
pm = api_create_claim(data: data, quote: 'Lorem Ipsum is used to generate dummy texts of the printing and IT industry.')
verbose_wait 3
api_create_claim(data: data, quote: 'Lorem Ipsum is used to generate dummy texts of the printing and IT industry!')
verbose_wait 3
@driver.navigate.to "#{@config['self_url']}/#{data[:team].slug}/media/#{pm.id}"
wait_for_selector('.media__more-medias')
expect(@driver.find_elements(:css, '.media__relationship').size).to eq 1
end

it 'should identify videos as similar', bin7: true do
api_create_team_and_bot(bot: 'alegre')
@driver.navigate.to "#{@config['self_url']}/#{@slug}/settings/workspace"
create_image('files/video.mp4')
verbose_wait 5
wait_for_selector('.cluster-card')
create_image('files/video2.mp4')
verbose_wait 5
wait_for_selector('.cluster-card').click
it 'should identify texts as similar with vector search', bin7: true do
data = api_create_team_and_bot(bot: 'alegre', score: { 'master_similarity_enabled' => true, 'text_similarity_enabled' => true, 'text_elasticsearch_matching_threshold' => 0.9, 'text_elasticsearch_suggestion_threshold' => 0.7, 'text_vector_matching_threshold' => 0.95, 'text_vector_suggestion_threshold' => 0.75, 'text_similarity_model' => ['elasticsearch', 'xlm-r-bert-base-nli-stsb-mean-tokens'], 'alegre_model_in_use' => ['elasticsearch', 'xlm-r-bert-base-nli-stsb-mean-tokens'], 'min_es_score' => 100_000 })
pm = api_create_claim(data: data, quote: 'In January 2003, Batista joined Triple H, Ric Flair and Randy Orton to form the heel stable Evolution.[25] Batista, however, was sidelined for much of 2003 after he tore his right triceps muscle at a Raw live event in a tag team match alongside Orton against The Dudley Boyz.')
verbose_wait 3
api_create_claim(data: data, quote: 'In January 2003, Batista joined Triple H, Ric Flair and Randy Orton to form the heel stable Evolution.[25] Batista, however, was sidelined for much of 2003 after he tore his right triceps muscle at a Raw live event in a tag team match alongside Orton against The Dudley Boy.')
verbose_wait 3
@driver.navigate.to "#{@config['self_url']}/#{data[:team].slug}/media/#{pm.id}"
wait_for_selector('.media__more-medias')
expect(@driver.find_elements(:css, '.media__relationship').size).to eq 1
end

it 'should identify texts as similar with vector search enabled on two models', bin7: true do
data = api_create_team_and_bot(bot: 'alegre', score: { 'master_similarity_enabled' => true, 'text_similarity_enabled' => true, 'text_elasticsearch_matching_threshold' => 0.9, 'text_elasticsearch_suggestion_threshold' => 0.7, 'text_vector_matching_threshold' => 0.95, 'text_vector_suggestion_threshold' => 0.75, 'text_similarity_model' => ['elasticsearch', 'xlm-r-bert-base-nli-stsb-mean-tokens', 'paraphrase-multilingual-mpnet-base-v2'], 'alegre_model_in_use' => ['elasticsearch', 'xlm-r-bert-base-nli-stsb-mean-tokens', 'paraphrase-multilingual-mpnet-base-v2'], 'min_es_score' => 100_000 })
pm = api_create_claim(data: data, quote: 'The ends of the warp threads are usually fastened to beams. One end is fastened to one beam, the other end to a second beam, so that the warp threads all lie parallel and are all the same length. The beams are held apart to keep the warp threads taut.')
verbose_wait 3
api_create_claim(data: data, quote: 'The ends of the warp threads are usually fastened to beams. One end is fastened to one beam, the other end to a second beam, so that the warp threads all lie parallel and are all the same length. The beams are held apart to keep the warp threads tight.')
verbose_wait 3
@driver.navigate.to "#{@config['self_url']}/#{data[:team].slug}/media/#{pm.id}"
wait_for_selector('.media__more-medias')
expect(@driver.find_elements(:css, '.media__relationship').size).to eq 1
end

it 'should identify images as similar', bin7: true do
it 'should prepare environment for media similarity tests', bin8: true do
data = api_create_team_and_bot(bot: 'alegre', score: { min_es_score: 0 })
pm = api_create_claim(data: data, quote: 'Just kicking off Alegre service.')
sleep 60 # Wait for the item to be sent to Alegre
@driver.navigate.to "#{@config['self_url']}/#{data[:team].slug}/media/#{pm.id}"
wait_for_selector('.quote-media-card')
expect(@driver.find_elements(:css, '.quote-media-card').size).to eq 1
end

it 'should identify images as similar', bin8: true do
api_create_team_and_bot(bot: 'alegre')
@driver.navigate.to "#{@config['self_url']}/#{@slug}/settings/workspace"
create_image('files/similarity.jpg')
verbose_wait 4
wait_for_selector('.cluster-card')
Expand All @@ -100,7 +117,7 @@
expect(@driver.find_elements(:css, '.media__relationship').size).to eq 1
end

it 'should extract text from a image', bin7: true do
it 'should extract text from a image', bin8: true do
api_create_team_and_bot(bot: 'alegre')
@driver.navigate.to "#{@config['self_url']}/#{@slug}/settings/workspace"
create_image('files/ocr.png')
Expand All @@ -111,7 +128,7 @@
expect(@driver.page_source.include?('Test')).to be(true)
end

it 'should identify audios as similar', bin7: true do
it 'should identify audios as similar', bin8: true do
api_create_team_and_bot(bot: 'alegre')
@driver.navigate.to "#{@config['self_url']}/#{@slug}/settings/workspace"
create_image('files/audio.mp3')
Expand All @@ -123,4 +140,16 @@
wait_for_selector('.media__more-medias')
expect(@driver.find_elements(:css, '.media__relationship').size).to eq 1
end

it 'should identify videos as similar', bin8: true do
api_create_team_and_bot(bot: 'alegre')
create_image('files/video.mp4')
verbose_wait 6
wait_for_selector('.cluster-card')
create_image('files/video2.mp4')
verbose_wait 6
wait_for_selector('.cluster-card').click
wait_for_selector('.media__more-medias')
expect(@driver.find_elements(:css, '.media__relationship').size).to eq 1
end
end
Loading