Skip to content

Commit

Permalink
Disable perf_event_open test on GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
s7nfo committed Jul 2, 2024
1 parent 78e8172 commit 45311b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
python-version: '3.11' # Specify the Python version you need

- name: Run tests
run: sudo make test-python
run: make test-python
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test: test-python test-ruby
.PHONY: test-python
test-python:
@echo "Running Python tests..."
sudo PYTHONPATH=./python python -m unittest discover -s python/tests
PYTHONPATH=./python python -m unittest discover -s python/tests

# Ruby test target
.PHONY: test-ruby
Expand Down
9 changes: 7 additions & 2 deletions python/tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import unittest
import os
from cirron import Tracer, Collector

IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"


class Test(unittest.TestCase):
def test_tracer(self):
with Tracer() as t:
print(0)

self.assertEqual(len(t.trace), 3)

@unittest.skipIf(IN_GITHUB_ACTIONS, "As of 02/07/2024, GitHub Actions does not support perf_event_open.")
def test_collector(self):
with Collector() as c:
print(0)

self.assertGreater(c.counters.time_enabled_ns, 0)

0 comments on commit 45311b2

Please sign in to comment.