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

clean up the pr diff message #6098

Merged
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
4 changes: 2 additions & 2 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ local manifest(apps) = pipeline('manifest') {
steps: [
make('check-drone-drift', container=false) { depends_on: ['clone'] },
make('check-generated-files', container=false) { depends_on: ['clone'] },
make('test', container=false) { depends_on: ['clone'] },
run('clone-main', commands=['cd ..', 'git clone $CI_REPO_REMOTE loki-main', 'cd -']),
run('clone-main', commands=['cd ..', 'git clone $CI_REPO_REMOTE loki-main', 'cd -']) { depends_on: ['clone'] },
make('test', container=false) { depends_on: ['clone', 'clone-main'] },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clone-main changes to another directory and that changes the directory for all jobs in this pipeline causing concurrent jobs to run. This change makes sure everything is cloned and ready before we try to run tests.

run('test-main', commands=['cd ../loki-main', 'BUILD_IN_CONTAINER=false make test']) { depends_on: ['clone-main'] },
make('compare-coverage', container=false, args=[
'old=../loki-main/test_results.txt',
Expand Down
17 changes: 10 additions & 7 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,22 @@ steps:
image: grafana/loki-build-image:0.20.4
name: check-generated-files
- commands:
- make BUILD_IN_CONTAINER=false test
- cd ..
- git clone $CI_REPO_REMOTE loki-main
- cd -
depends_on:
- clone
environment: {}
image: grafana/loki-build-image:0.20.4
name: test
name: clone-main
- commands:
- cd ..
- git clone $CI_REPO_REMOTE loki-main
- cd -
- make BUILD_IN_CONTAINER=false test
depends_on:
- clone
- clone-main
environment: {}
image: grafana/loki-build-image:0.20.4
name: clone-main
name: test
- commands:
- cd ../loki-main
- BUILD_IN_CONTAINER=false make test
Expand Down Expand Up @@ -1164,6 +1167,6 @@ kind: secret
name: deploy_config
---
kind: signature
hmac: 4596e741ac788d461b3bbb2429c1f61efabaf943aeec6b3cd59eeff8d769de5e
hmac: e3f0cead040a655e51244d5d71377a4ba506d7f63fae440593f6e7d14018a1e3

...
7 changes: 6 additions & 1 deletion tools/diff_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ if [[ ! -f "$1" ]] || [[ ! -f "$2" ]]; then
exit 0
fi

echo
echo
echo '**Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.**'
echo

echo '```diff'
for pkg in ${3//,/ }; do
old=$(grep "pkg/${pkg}\s" "$1" | sed s/%// | awk '{print $5}')
new=$(grep "pkg/${pkg}\s" "$2" | sed s/%// | awk '{print $5}')
echo | awk -v pkg="${pkg}" -v old="${old:-0}" -v new="${new:-0}" \
'{
sign=new - old < 0 ? "-" : "+"
printf ("%s %11s\t%s\n", sign, pkg, new - old)
printf ("%s %18s\t%s%%\n", sign, pkg, new - old)
}'
done
echo '```'