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

Fix coverage CI #194

Merged
merged 14 commits into from Oct 5, 2020
Merged

Fix coverage CI #194

merged 14 commits into from Oct 5, 2020

Conversation

TotallyNotChase
Copy link
Contributor

  • Make coverage report CI use checkout@v2, followed by the manual build process . (previously was using gwion-action)
  • Make "Generate report" step deduce branchname correctly for both push and PR event
  • Make "Send mail" step only execute when the repository owner is fennecdjay

@TotallyNotChase
Copy link
Contributor Author

looks like the fields for email simply doesn't exist on PRs, even if the correct secret variables are set

@fennecdjay
Copy link
Member

I really like how you setup this whole work, with the issues before and the summary in the PR body 😄

It's a shame it is failing! 😖
What do you think of the id of keeping only the 101 first lines of the workflow? Mail are only for me, so I think I'd rather check myself coverage when there is a code change than annoy everybody with this mail step. (however, If you have a better idea...)

I was looking at your repo and noticed that all OS tests used gwion-action. I thought I had changed those a while back!

However I think it can easily be solved with a bash trick:

cd .github/workflows
for cifile in linux.yml macos.yml windows.yml
do
  awk '1;/steps:/{exit}' $cifile > $cifile.tmp
  cat << EOF >> $cifile.tmp
    - name Checkout
      uses: actions/checkout@v2

    - name: Init submodules
      run: git submodule update --init util ast

    - name: Build
      run: make
      env:
        CC: \${{ matrix.cc }}
        USE_DOUBLE: \${{ matrix.double }}
        USE_DEBUG: 1

    - name: Test
      run: make test
EOF
  mv $cifile.tmp $cifile;
done
cd ../..

The issue remains to create. Would you be interrested on this one?

@TotallyNotChase
Copy link
Contributor Author

What do you think of the id of keeping only the 101 first lines of the workflow? Mail are only for me, so I think I'd rather check myself coverage when there is a code change than annoy everybody with this mail step. (however, If you have a better idea...)

sounds good.

I was looking at your repo and noticed that all OS tests used gwion-action. I thought I had changed those a while back!

yeah that's what I was talkin about in this comment haha. I will try fixing that, sure.

Comment on lines +56 to +62
if [ "${{ github.event_name }}" == "push" ]
then
ref="${{ github.ref }}"
else
ref="${{ github.event.head.ref }}"
fi
branch=$(basename ref)
Copy link
Member

Choose a reason for hiding this comment

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

Pretty useful snippet here.

.github/workflows/coverage.yml Show resolved Hide resolved
.github/workflows/coverage.yml Outdated Show resolved Hide resolved
Comment on lines +24 to +25
- name: Init submodules
run: git submodule update --init util ast
Copy link
Member

Choose a reason for hiding this comment

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

Submodules on their own place is nice.

dir: .
ref: ${{ github.sha }}
run: 'true'
- name: Checkout
Copy link
Member

@fennecdjay fennecdjay Oct 4, 2020

Choose a reason for hiding this comment

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

That's the thing asked for in the issue, you uncovered so many things beyond that!
Thank you.

@fennecdjay
Copy link
Member

fennecdjay commented Oct 4, 2020

You made it all green! That's awesome.
Could you just please change ${{ matrix.cc }} to gcc in windows builds? (see my comment above)
That and confirming you're ready to merge 😄


see my comment below ... I'm not yet famliar with github reviews.

.github/workflows/linux.yml Outdated Show resolved Hide resolved
.github/workflows/macos.yml Outdated Show resolved Hide resolved
.github/workflows/windows.yml Outdated Show resolved Hide resolved
@fennecdjay
Copy link
Member

I see the problem: the error in the newly modified yml files was not caught because they only trigger on pushes.
Could be yet another another issue. We need it to trigger on PRs, as we could introduce an error in the main repo/branch and only notice after merging.
The pull-request should trigger on all branches but gh-pages as for the push event.


I can't say how grateful I already am. You did a fair amount of work, pretty seriously as far as I'm concerned. I learned so much, thank you!

@TotallyNotChase
Copy link
Contributor Author

whoops, didn't notice the missing colons

@fennecdjay
Copy link
Member

fennecdjay commented Oct 4, 2020

Neither did I when I posted the script 😄
It should make things greener on your side.

@TotallyNotChase
Copy link
Contributor Author

Ah, windows with its weird design choices again. Looks like %z is not being recognized as a valid format specifier

@fennecdjay
Copy link
Member

Ah, windows with its weird design choices again.

Can relate 😄

@TotallyNotChase
Copy link
Contributor Author

This SO thread may be helpful. Should this be a fix on the code side then?

@fennecdjay
Copy link
Member

fennecdjay commented Oct 4, 2020

Has your windows build BUILD_ON_WINDOWS set? this would address the %z issue.

The problem might be cannot find -lasan.
I think the solution to this is in util/common.k, where before
ifeq (${USE_DEBUG}, 1), there should be something along the lines of

ifeq (${BUILD_ON_WINDOWS}, 1)
USE_DEBUG=0
endif

so that windows builds do not try to link with sanitizer libraries, since their are not implemented as of now.

@TotallyNotChase
Copy link
Contributor Author

TotallyNotChase commented Oct 4, 2020

Would setting USE_DEBUG to 0 here work

Edit: and also replacing that with BUILD_ON_WINDOWS: 1

@fennecdjay
Copy link
Member

I think that's the trick 😄

@fennecdjay
Copy link
Member

fennecdjay commented Oct 4, 2020

TBH, I can't wait to see it all green (because I think it will 😄)

@fennecdjay
Copy link
Member

fennecdjay commented Oct 4, 2020

I was watching at the window testing live, so to say, and I think we need BUILD_ON_WINDOWS set in the testing step too, because when it run tests/sh/import.sh, some plugins are compiled, and that needs the variable set to run smoothly.


Also, the test suite fails to catch the error 😸

@TotallyNotChase
Copy link
Contributor Author

TotallyNotChase commented Oct 4, 2020

Could you tell me what modifications this needs? Should the build and test be separated?

@fennecdjay
Copy link
Member

fennecdjay commented Oct 4, 2020

TBH, I not sure what your this link refers to.

Assuming it's refering to

Also, the test suite fails to catch the error

First, we need to add set -e to tests/sh/import.sh.

It looks like the test_plugin function in tests/sh/import.sh does not run the test (while it set the options do run it correctly (incorrect, see footnote)).

It needs to call run, defined in tests/sh/common.sh.
But this function calls ./gwion, as if we where in the root directory of the project.

So the tests should be run for the root.
We have to remove the cd test/import line and make test_plugin work from the root directory. Hopefully I think it can be solved by adding the -C flag (as in changing make to make -C <import_test_directory>. As for the make clean line.
Remains to find how to handle the <import_test_directory> thing.
at the end of tests/sh/import.sh there will also be no need for cd "$BASE_DIR" || exit


There is GWOPT+=-p. test_gw in tests/sh/import.gw.
It should be changed to GWOPT+=-p <import_test_directory>.
The test_gw is totally irrelevant.

@TotallyNotChase
Copy link
Contributor Author

Ahh I see. I was referring to the conversation on Build and Test gwion in coverage.yml actually. That this link seems to just scroll up to it and puts the comment at the very top of the screen.

As for the tests/sh changes, I think it'd be better to work on that on a separate PR, since those aren't directly related to the action files, right?

@fennecdjay
Copy link
Member

Fix thing mentionned in my previous comment is totally up to you.
The changes you did in this PR are totally worth merging. Just let me know.

@fennecdjay
Copy link
Member

I think it'd be better to work on that on a separate PR

That's also better IMO.

@fennecdjay
Copy link
Member

fennecdjay commented Oct 4, 2020

I was referring to the conversation on Build and Test

It's easier when maintaining to have separate steps to look for for build and and test, so I think these should be separated.

@TotallyNotChase
Copy link
Contributor Author

Extended changelog:-

  • Remove "Send mail" step from coverage.yml
  • Use manual checkout + make build in linux.yml, macos.yml, and windows.yml - replaces gwion-action

@fennecdjay
Copy link
Member

Just reviewed your changes. Looks good to me!
Did I forgot something or are you OK to merge?

@TotallyNotChase
Copy link
Contributor Author

I think that should be all for the CI fixes. Should be good to merge

@fennecdjay
Copy link
Member

I think so.
Merging right now.
Thanks for the great work!

@fennecdjay fennecdjay merged commit 99eab3c into Gwion:master Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants