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

Add initial CI #6

Merged
merged 14 commits into from
Nov 17, 2022
Merged

Add initial CI #6

merged 14 commits into from
Nov 17, 2022

Conversation

bbannier
Copy link
Member

@bbannier bbannier commented Oct 5, 2022

Closes #4.

@bbannier bbannier self-assigned this Oct 5, 2022
@bbannier bbannier force-pushed the topic/bbannier/initial-ci branch 3 times, most recently from 2a62dac to d6700cb Compare October 6, 2022 08:17
@bbannier
Copy link
Member Author

bbannier commented Oct 6, 2022

This PR is in principle ready for a first review. It provides tests for template features (either by running a full build & test, or with smoke tests), and a pre-commit config for linting (when a linter required fixes to existing sources I tried to put that in its own commit). The CI runs in GH which is probably okay since it should finish quickly.

It should probably still go in after #2 so I can add additional tests and make linter fixes.

Interesting bits:

@bbannier bbannier marked this pull request as ready for review October 6, 2022 08:21
@bbannier bbannier requested a review from ckreibich October 25, 2022 10:41
@bbannier bbannier force-pushed the topic/bbannier/initial-ci branch 5 times, most recently from 6f8fd62 to b1e3be2 Compare October 28, 2022 12:19
@bbannier bbannier requested a review from rsmmr October 28, 2022 12:25
@bbannier
Copy link
Member Author

I rebased this onto the latest master and rewrote the recently merged Spicy feature tests into btests. Would be great if you could have a look @ckreibich @rsmmr.

When executing `zkg` concurrently multiple updates to the sources can
race and destroy each others state. Disable that update. This is a
workaround for zeek/package-manager#139.
@bbannier bbannier force-pushed the topic/bbannier/initial-ci branch 2 times, most recently from c5c0ec8 to 28ddc6b Compare October 31, 2022 10:59
@bbannier
Copy link
Member Author

bbannier commented Oct 31, 2022

While figuring out how to make this work against a nightly Zeek I noticed that the new zkg wrapper introduced additional issues (filed zeek/package-manager#144 and added a workaround; fixed GH execution for zeek/package-manager#145).

@bbannier bbannier force-pushed the topic/bbannier/initial-ci branch 2 times, most recently from 0963e2f to 90f2efb Compare November 8, 2022 11:08
@bbannier bbannier requested a review from rsmmr November 8, 2022 11:14
Copy link
Member

@ckreibich ckreibich left a comment

Choose a reason for hiding this comment

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

Looking great, thank you! I only have some minor requests (though see that black comment).

The only hiccup is that when I run this locally (with Zeek 5.2.0-dev.51), the features.spicy-packet-analyzer test errors with:

[#1] tests.availability ... ok
[#2] tests.trace ... failed
  % 'zeek -Cr ${TRACES}/raw-layer.pcap ${PACKAGE} /home/christian/devel/zeek/package-template/tests/.tmp/features.spicy-packet-analyzer/test/testing/.tmp/tests.trace/trace.zeek >output' failed unexpectedly (exit code 1)
  % cat .stderr
  error in /home/christian/devel/zeek/package-template/tests/.tmp/features.spicy-packet-analyzer/test/testing/../scripts/./main.zeek, line 12: unknown identifier PacketAnalyzer::ANALYZER_SPICY_MYANALYZER957136, at or near "PacketAnalyzer::ANALYZER_SPICY_MYANALYZER957136"

1 of 2 tests failed

I'll look into that a bit since I'm noticing it's not failing in CI. Probably just something silly on my machine.

tests/btest.cfg Show resolved Hide resolved
tests/features/github-ci Show resolved Hide resolved
tests/features/spicy-protocol-analyzer/tcp-two-units Outdated Show resolved Hide resolved
tests/features/spicy-protocol-analyzer/tcp-two-units Outdated Show resolved Hide resolved
tests/features/spicy-file-analyzer Show resolved Hide resolved
tests/features/spicy-protocol-analyzer/udp-two-units Outdated Show resolved Hide resolved
tests/scripts/stray_baselines.py Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
__init__.py Show resolved Hide resolved
@bbannier
Copy link
Member Author

The only hiccup is that when I run this locally (with Zeek 5.2.0-dev.51), the features.spicy-packet-analyzer test errors with: ...

I added some Zeek preprocessor branch to the Spicy packet analyzer template which branches on versions before or after 5.2.0, but your dev snapshot seems to be from before that branch. Somewhere on the 5.2 dev branch I bumped a spicy-plugin change from Robin removes double underscores from packet analyzer names, but your snapshot seems to miss that.

@bbannier bbannier force-pushed the topic/bbannier/initial-ci branch from 90f2efb to f330885 Compare November 15, 2022 07:59
@bbannier bbannier force-pushed the topic/bbannier/initial-ci branch from f330885 to 227e665 Compare November 16, 2022 13:08
@bbannier bbannier force-pushed the topic/bbannier/initial-ci branch from 227e665 to 282914d Compare November 16, 2022 13:16
@bbannier bbannier requested a review from ckreibich November 16, 2022 13:26
@ckreibich ckreibich merged commit 51be25b into master Nov 17, 2022
@ckreibich ckreibich deleted the topic/bbannier/initial-ci branch November 17, 2022 23:48
@ckreibich
Copy link
Member

Yeah Benjamin it all works now over here too. Thanks!

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.

We need CI
3 participants