Skip to content

test: accept the hex CSRF token of Adminer 6.3.1 - #60

Merged
rfay merged 1 commit into
ddev:mainfrom
rfay:20261124_rfay_adminer_token
Nov 24, 2026
Merged

rfay merged 1 commit into
ddev:mainfrom
rfay:20261124_rfay_adminer_token

Conversation

@rfay

@rfay rfay commented Nov 24, 2026

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

The sqlite test now accepts any Adminer CSRF token format, because Adminer 6.3.1 switched from digits to hex and broke the nightly tests.

The Issue

The nightly tests failed on all four jobs on 2026-11-24 in run 45356694839. The same commit passed every night before.

The adminer:6-standalone image moved to Adminer 6.3.1 between those runs. Adminer 6.3.1 writes its CSRF token as hex:hex, and earlier releases wrote digits:digits. The test searched for [0-9]+:[0-9]+ inside a command substitution. That grep matched nothing, so set -e stopped health_checks at tests/test.bats:101 and printed no reason.

The add-on itself works with Adminer 6.3.1. A sqlite insert with the hex token succeeds.

How This PR Solves The Issue

The test fetches the SQL page with run curl and asserts that it contains a name='token' field. It then takes the field's value whatever its format. If Adminer drops the token again, the failure shows the page instead of exiting silently.

Manual Testing Instructions

mkdir adminer-sqlite && cd adminer-sqlite
ddev config --project-type=php --omit-containers=db
ddev dotenv set .ddev/.env.adminer --adminer-default-driver=sqlite --adminer-default-db=/mnt/ddev_app/test.sqlite
ddev add-on get ddev/ddev-adminer --pr 60
ddev restart
ddev exec sqlite3 test.sqlite "CREATE TABLE items(id INTEGER PRIMARY KEY, name TEXT);"
ddev adminer
# Expect the items table, and an INSERT from the SQL command page to succeed

Automated Testing Overview

Claude Code ran bats ./tests/test.bats --filter-tags sqlite on Linux amd64 with DDEV v1.25.6 and Adminer 6.3.1, and the test passed. On that machine, the ddev adminer URL assertion fails for an unrelated local reason, so that one assertion was removed for the run. CI also runs that assertion, and the arm64 and DDEV HEAD jobs, so CI has to confirm them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UrTUMupgLNPn18VBZJrtex

## Short Summary (TL;DR)

The sqlite test now accepts any Adminer CSRF token format, because Adminer 6.3.1 switched from digits to hex and broke the nightly tests.

## The Issue

The nightly tests failed on all four jobs on 2026-11-24 in [run 45356694839](https://github.com/ddev/ddev-adminer/actions/runs/45356694839). The same commit passed every night before.

The `adminer:6-standalone` image moved to Adminer 6.3.1 between those runs. Adminer 6.3.1 writes its CSRF token as `hex:hex`, and earlier releases wrote `digits:digits`. The test searched for `[0-9]+:[0-9]+` inside a command substitution. That grep matched nothing, so `set -e` stopped `health_checks` at `tests/test.bats:101` and printed no reason.

The add-on itself works with Adminer 6.3.1. A sqlite insert with the hex token succeeds.

## How This PR Solves The Issue

The test fetches the SQL page with `run curl` and asserts that it contains a `name='token'` field. It then takes the field's value whatever its format. If Adminer drops the token again, the failure shows the page instead of exiting silently.

## Manual Testing Instructions

```bash
mkdir adminer-sqlite && cd adminer-sqlite
ddev config --project-type=php --omit-containers=db
ddev dotenv set .ddev/.env.adminer --adminer-default-driver=sqlite --adminer-default-db=/mnt/ddev_app/test.sqlite
ddev add-on get ddev/ddev-adminer --pr 60
ddev restart
ddev exec sqlite3 test.sqlite "CREATE TABLE items(id INTEGER PRIMARY KEY, name TEXT);"
ddev adminer
# Expect the items table, and an INSERT from the SQL command page to succeed
```

## Automated Testing Overview

Claude Code ran `bats ./tests/test.bats --filter-tags sqlite` on Linux amd64 with DDEV v1.25.6 and Adminer 6.3.1, and the test passed. On that machine, the `ddev adminer` URL assertion fails for an unrelated local reason, so that one assertion was removed for the run. CI also runs that assertion, and the arm64 and DDEV HEAD jobs, so CI has to confirm them.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01UrTUMupgLNPn18VBZJrtex

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrTUMupgLNPn18VBZJrtex

@rfay rfay left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems like it works!

@rfay
rfay merged commit 8d749ea into ddev:main Nov 24, 2026
4 checks passed
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.

2 participants