Skip to content

Web: Improve Capture list display in admin interface #160

Web: Improve Capture list display in admin interface

Web: Improve Capture list display in admin interface #160

GitHub Actions / Test Results failed Sep 28, 2024 in 0s

1 fail, 2 skipped, 75 pass in 38s

78 tests  ±0   75 ✅  - 1   38s ⏱️ -1s
 1 suites ±0    2 💤 ±0 
 1 files   ±0    1 ❌ +1 

Results for commit 5b26417. ± Comparison against earlier commit 174ff92.

Annotations

Check warning on line 0 in tests.controller.test_main_loop.MainLoopTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_first_tick (tests.controller.test_main_loop.MainLoopTest) failed

.tox/py311/log/results.xml [took 0s]
Raw output
sqlite3.OperationalError: cannot commit - no transaction is active
self = <test_main_loop.MainLoopTest testMethod=test_first_tick>
sleep_mock = <MagicMock name='sleep' id='139699942549264'>

    @patch('time.sleep')
    def test_first_tick(self, sleep_mock):
        with transaction_cursor(self.connection) as cursor:
            cursor.execute('UPDATE scoring_gamecontrol SET start = datetime("now"), '
                           '                               end = datetime("now", "+1 day")')
    
        controller.main_loop_step(self.connection, self.metrics, Lock(), False)
        sleep_mock.assert_called_once_with(0)
    
        with transaction_cursor(self.connection) as cursor:
            cursor.execute('SELECT current_tick FROM scoring_gamecontrol')
            new_tick = cursor.fetchone()[0]
        self.assertEqual(new_tick, 0)
    
        with transaction_cursor(self.connection) as cursor:
            cursor.execute('SELECT cancel_checks FROM scoring_gamecontrol')
            cancel_checks = cursor.fetchone()[0]
        self.assertFalse(cancel_checks)
    
>       with transaction_cursor(self.connection) as cursor:

tests/controller/test_main_loop.py:62: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.11/contextlib.py:144: in __exit__
    next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

db_conn = <sqlite3.Connection object at 0x7f0e6dd231f0>, always_rollback = False

    @contextmanager
    def transaction_cursor(db_conn, always_rollback=False):
        """
        Context Manager providing a cursor within a database transaction for any PEP 249-compliant database
        connection (with support for transactions). The transaction will be committed after leaving the context
        and rolled back when an exception occurs in the context.
        Context Managers for the database are not specified by PEP 249 and implemented by some libraries (e.g.
        psycopg2) in ways incompatible to each other.
    
        Args:
            db_conn: A PEP 249-compliant database connection.
            always_rollback: Do never commit transactions, but always roll them back. Useful for testing the
                             required grants (at least with some databases).
        """
    
        # A transaction BEGINs implicitly when the previous one has been finalized
        cursor = db_conn.cursor()
    
        if isinstance(cursor, sqlite3.Cursor):
            if sqlite3.threadsafety < 2:
                raise Exception('SQLite must be built with thread safety')
    
            cursor = _SQLite3Cursor(cursor)
    
        try:
            yield cursor
        except:    # noqa
            db_conn.rollback()
            raise
    
        if always_rollback:
            db_conn.rollback()
        else:
>           db_conn.commit()
E           sqlite3.OperationalError: cannot commit - no transaction is active

.tox/py311/lib/python3.11/site-packages/ctf_gameserver/lib/database.py:38: OperationalError

Check notice on line 0 in .github

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 skipped tests found

There are 2 skipped tests, see "Raw output" for the full list of skipped tests.
Raw output
tests.checker.test_integration.IntegrationTest ‑ test_sudo
tests.checker.test_integration.IntegrationTest ‑ test_sudo_unfinished

Check notice on line 0 in .github

See this annotation in the file changed.

@github-actions github-actions / Test Results

78 tests found

There are 78 tests, see "Raw output" for the full list of tests.
Raw output
tests.checker.test_integration.IntegrationTest ‑ test_basic
tests.checker.test_integration.IntegrationTest ‑ test_cancel_checks
tests.checker.test_integration.IntegrationTest ‑ test_down
tests.checker.test_integration.IntegrationTest ‑ test_exception
tests.checker.test_integration.IntegrationTest ‑ test_missing_checkerscript
tests.checker.test_integration.IntegrationTest ‑ test_multi_teams_ticks
tests.checker.test_integration.IntegrationTest ‑ test_shutdown
tests.checker.test_integration.IntegrationTest ‑ test_state
tests.checker.test_integration.IntegrationTest ‑ test_sudo
tests.checker.test_integration.IntegrationTest ‑ test_sudo_unfinished
tests.checker.test_integration.IntegrationTest ‑ test_unfinished
tests.checker.test_master.MasterTest ‑ test_handle_flag_request
tests.checker.test_master.MasterTest ‑ test_handle_result_request
tests.checker.test_master.MasterTest ‑ test_update_launch_params
tests.checker.test_metrics.MetricsTest ‑ test_counter
tests.checker.test_metrics.MetricsTest ‑ test_custom_label
tests.checker.test_metrics.MetricsTest ‑ test_gauge
tests.checker.test_metrics.MetricsTest ‑ test_histogram
tests.checker.test_metrics.MetricsTest ‑ test_multiple
tests.checker.test_metrics.MetricsTest ‑ test_service_label
tests.checker.test_metrics.MetricsTest ‑ test_summary
tests.checkerlib.test_local.LocalTest ‑ test_get_flag
tests.checkerlib.test_local.LocalTest ‑ test_run_check_basic
tests.checkerlib.test_local.LocalTest ‑ test_run_check_exception
tests.checkerlib.test_local.LocalTest ‑ test_run_check_exception_timeout
tests.checkerlib.test_local.LocalTest ‑ test_run_check_flag_fail
tests.checkerlib.test_local.LocalTest ‑ test_run_check_not_recovering
tests.checkerlib.test_local.LocalTest ‑ test_run_check_place_fail
tests.checkerlib.test_local.LocalTest ‑ test_run_check_recovering
tests.checkerlib.test_local.LocalTest ‑ test_run_check_service_fail
tests.checkerlib.test_local.LocalTest ‑ test_run_check_tick0
tests.checkerlib.test_local.LocalTest ‑ test_run_check_tick3
tests.checkerlib.test_local.LocalTest ‑ test_state_object
tests.checkerlib.test_local.LocalTest ‑ test_state_primitive
tests.controller.test_main_loop.DatabaseTest ‑ test_prohibit_changes
tests.controller.test_main_loop.MainLoopTest ‑ test_after_game_nonstop
tests.controller.test_main_loop.MainLoopTest ‑ test_before_game
tests.controller.test_main_loop.MainLoopTest ‑ test_first_tick
tests.controller.test_main_loop.MainLoopTest ‑ test_last_tick
tests.controller.test_main_loop.MainLoopTest ‑ test_long_after_game
tests.controller.test_main_loop.MainLoopTest ‑ test_next_tick_overdue
tests.controller.test_main_loop.MainLoopTest ‑ test_next_tick_undue
tests.controller.test_main_loop.MainLoopTest ‑ test_null
tests.controller.test_main_loop.MainLoopTest ‑ test_shortly_after_game
tests.controller.test_scoring.EmptyScoringTest ‑ test_scoreboard
tests.controller.test_scoring.ScoringTest ‑ test_scoreboard
tests.controller.test_sleep_seconds.SleepSecondsTest ‑ test_before
tests.controller.test_sleep_seconds.SleepSecondsTest ‑ test_during_1
tests.controller.test_sleep_seconds.SleepSecondsTest ‑ test_during_2
tests.controller.test_sleep_seconds.SleepSecondsTest ‑ test_late
tests.controller.test_sleep_seconds.SleepSecondsTest ‑ test_start
tests.lib.test_args.HostPortTest ‑ test_hostname
tests.lib.test_args.HostPortTest ‑ test_invalid
tests.lib.test_args.HostPortTest ‑ test_ipv4
tests.lib.test_args.HostPortTest ‑ test_ipv6
tests.lib.test_date_time.EnsureUTCAwareTest ‑ test_datetime_berlin
tests.lib.test_date_time.EnsureUTCAwareTest ‑ test_datetime_unaware
tests.lib.test_date_time.EnsureUTCAwareTest ‑ test_datetime_utc
tests.lib.test_date_time.EnsureUTCAwareTest ‑ test_none
tests.lib.test_date_time.EnsureUTCAwareTest ‑ test_time_unaware
tests.lib.test_date_time.EnsureUTCAwareTest ‑ test_time_utc
tests.lib.test_flag.FlagTestCase ‑ test_deterministic
tests.lib.test_flag.FlagTestCase ‑ test_invalid_format
tests.lib.test_flag.FlagTestCase ‑ test_invalid_mac
tests.lib.test_flag.FlagTestCase ‑ test_known_flags
tests.lib.test_flag.FlagTestCase ‑ test_old_flag
tests.lib.test_flag.FlagTestCase ‑ test_valid_flag
tests.submission.test_server.ServerTest ‑ test_after_competition
tests.submission.test_server.ServerTest ‑ test_basic
tests.submission.test_server.ServerTest ‑ test_invalid
tests.submission.test_server.ServerTest ‑ test_multiple_clients
tests.submission.test_server.ServerTest ‑ test_multiple_flags
tests.submission.test_server.ServerTest ‑ test_out_of_order
tests.vpnstatus.test_status.VPNStatusTest ‑ test_net_numbers
tests.vpnstatus.test_status.VPNStatusTest ‑ test_nothing
tests.vpnstatus.test_status.VPNStatusTest ‑ test_ping
tests.vpnstatus.test_status.VPNStatusTest ‑ test_tcp
tests.vpnstatus.test_status.VPNStatusTest ‑ test_wireguard