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

🎉 Compare versions tool #24421

Merged
merged 4 commits into from
Mar 27, 2023
Merged
Changes from 2 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
28 changes: 28 additions & 0 deletions tools/internal/compare_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

# Read input params
read -r -p 'Enter connector name: ' connector
read -r -p 'Enter first connector version: ' version_1
read -r -p 'Enter second connector version: ' version_2

printf "\nPulling connectors images:\n"

docker pull airbyte/"$connector":"$version_1"
docker pull airbyte/"$connector":"$version_2"
lazebnyi marked this conversation as resolved.
Show resolved Hide resolved

printf "\nStarting comparing connector %s version %s with version %s:\n" "$connector" "$version_1" "$version_2"


run_docker_image()
{
echo docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/"$connector":"$version" read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
}

result=$( diff <(run_docker_image "$connector", "$version_1") <(run_docker_image "$connector", "$version_2") | grep 'RECORD' | sed '/\"emitted_at\"/,/}/ d')

if [ -n "$result" ]; then
printf "%s" "$result"
printf "Records output not equal."
else
printf "Records output equal."
fi