Skip to content

Commit

Permalink
test: update tests that west.yaml becamse a generic yaml for configur…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
Tomas Peterka committed Feb 26, 2024
1 parent 25469f8 commit 25c74e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ manifest:
revision: v1.0.0
import: true

gira:
observe:
dep1-west: "file://${GIRA_TEST_ROOT}/remote/dep1/.git"
gira:
observe:
dep1-west: "file://${GIRA_TEST_ROOT}/remote/dep1/.git"
20 changes: 10 additions & 10 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ envsubst < local-template/poetry/pyproject.toml > local/poetry/pyproject.toml
envsubst < local-template/poetry/poetry.lock > local/poetry/poetry.lock
envsubst < local-template/pyproject.toml > local/pyproject.toml
envsubst < local-template/pubspec.yaml > local/pubspec.yaml
envsubst < local-template/west.yaml > local/west.yaml
envsubst < local-template/west.yml > local/west.yml
envsubst < local-template/.gira.yaml > local/.gira.yaml


Expand Down Expand Up @@ -70,8 +70,8 @@ grep OCD-567 output.txt
echo "-- Test pubspec.yaml"
git reset --hard
rm -rf .gira_cache output.txt
sed -i 's/1.0.0/1.1.0/g' west.yaml
gira -c west.yaml > output.txt
sed -i 's/1.0.0/1.1.0/g' west.yml
gira -c west.yml > output.txt
grep dep1-west output.txt
grep OCD-1234 output.txt
grep -v OCD-567 output.txt
Expand All @@ -80,28 +80,28 @@ grep -v OCD-567 output.txt
echo "-- Test moving from 1.0.0 to 1.1.0 and then to 1.1.1"
git reset --hard
rm -rf .gira_cache output.txt
sed -i 's/1.0.0/1.1.0/g' west.yaml
gira -c west.yaml > output.txt
sed -i 's/1.0.0/1.1.0/g' west.yml
gira -c west.yml > output.txt
grep OCD-1234 output.txt
grep -v OCD-567 output.txt
# now move to 1.1.1
sed -i 's/1.1.0/1.1.1/g' west.yaml
gira -c west.yaml > output.txt
sed -i 's/1.1.0/1.1.1/g' west.yml
gira -c west.yml > output.txt
grep OCD-1234 output.txt
grep OCD-567 output.txt


echo "-- Test pre-commit"
git reset --hard
rm -rf .gira_cache output.txt
sed -i 's/1.0.0/1.1.1/g' west.yaml
sed -i 's/1.0.0/1.1.1/g' west.yml
echo "" > .git/COMMIT_EDITMSG # clear the commit message
gira -c west.yaml .git/COMMIT_EDITMSG
gira -c west.yml .git/COMMIT_EDITMSG
grep OCD-1234 .git/COMMIT_EDITMSG # gira should output there instead of stdout
grep OCD-567 .git/COMMIT_EDITMSG # gira should output there instead of stdout

echo "should stay" > randomFile.txt
gira -c west.yaml randomFile.txt # gira must not override anything else than the commit message file
gira -c west.yml randomFile.txt # gira must not override anything else than the commit message file
grep "should stay" randomFile.txt # gira should not touch the file
grep -v OCD-1234 randomFile.txt
grep -v OCD-567 randomFile.txt
Expand Down

0 comments on commit 25c74e5

Please sign in to comment.