I put together a clean setup in docker for running the tests and believe I've gotten to the source of the problem.
However I've thought that a few times now.

This version of the patch has all tests passing.
The problem was in org-results-to-file and the attach dir detection. It both had problems with an introduced assumption that the buffer-file-name would be non-nil (causing several tests to fail) as well as being generally overzealous in detecting file result paths as attachment links.


On Mon, Jun 13, 2022 at 10:55 PM Ryan Scott <ryan@vicarious-living.com> wrote:
Strange. I'll figure out a better setup for running the tests and get to the bottom of that.
Thanks for the help.

On Tue, Jun 14, 2022, 00:10 Ihor Radchenko <yantar92@gmail.com> wrote:
Ryan Scott <ryan@vicarious-living.com> writes:

> Ah sorry about that. I'm on a windows laptop and didn't have make, so was
> testing interactively and they were passing.
> I cleaned that up and remove the f-* usage and verified under Ubuntu (on
> WSL) that the new tests are passing. I was getting some failures with
> unrelated tests, but also get those in master as well.

I am still getting test failures using Emacs 28.
All the tests are passing on main.

Example backtrace:

file-name-directory(nil)
  org-babel-result-to-file("/tmp/test.txt" nil attachment)
  org-babel-insert-result("/tmp/test.txt" ("replace" "value" "file" "g
  org-babel-execute-src-block()
  (progn (org-mode) (let ((point (string-match "<point>" inside-text))
  (unwind-protect (progn (org-mode) (let ((point (string-match "<point
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
  (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current
  (let ((inside-text (if (stringp "\n<point>#+begin_src shell :results
  (let ((lexical-binding nil)) (let ((inside-text (if (stringp "\n<poi
  (lambda nil (let ((lexical-binding nil)) (let ((inside-text (if (str
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name test-ob/result-graphics-link-type-hea
  ert-run-or-rerun-test(#s(ert--stats :selector "test-ob" :tests ... :
  ert-run-tests("test-ob" #f(compiled-function (event-type &rest event
  ert-run-tests-batch("test-ob")
  ert-run-tests-batch-and-exit("test-ob")
  (let ((org-id-track-globally t) (org-test-selector (if org-test-sele
  org-test-run-batch-tests("test-ob")
  command-line-1(("--eval" "(setq vc-handled-backends nil org-startup-
  command-line()
  normal-top-level()
Test test-ob/result-graphics-link-type-header-argument condition:
    (wrong-type-argument stringp nil)
   FAILED  129/140  test-ob/result-graphics-link-type-header-argument (0.006189 sec)

Best,
Ihor