Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rogpeppe/go-internal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.12.0
Choose a base ref
...
head repository: rogpeppe/go-internal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.13.1
Choose a head ref
  • 18 commits
  • 35 files changed
  • 8 contributors

Commits on Feb 16, 2024

  1. testscript: fix ptyName() returning /dev/pts/4294967296 on s390x

    Use uint32 instead of uint (64-bit in Go on s390x) to store the return
    value of the TIOCGPTN syscall.  This is to avoid the 32-bit value from
    being stored into a 64-bit buffer and get left-shifted by 32 when
    dereferencing, turning what should be /dev/pts/1 to /dev/pts/4294967296
    on big-endian architectures such as s390x.
    
    Special thanks to the explanation and a similar bug fix provided at
    containerd/console#51
    anthonyfok authored and mvdan committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    8e66eb9 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2024

  1. all: Move away from ioutil

    It's been a while since io/ioutil has been deprecated.
    Go 1.22 was just released, and the go.mod specifies 'go 1.20'.
    This should be safe to remove at this point.
    
    The change was largely automated, minus the `t.TempDir()` calls inside
    test files, which was done manually.
    abhinav authored and mvdan committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    301d1b7 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. testscript: add doc link to gotooltest

    Otherwise it's not obvious that the "go" commands aren't a built-in feature.
    rudifa authored Apr 11, 2024
    Configuration menu
    Copy the full SHA
    9d241da View commit details
    Browse the repository at this point in the history
  2. testscript: Add Chdir method to change directory

    It is not currently possible for a custom testscript command
    to change the working directory of that script run.
    `TestScript.Exec` runs the command in a subprocess,
    so one cannot do `ts.Exec("cd", dir)`.
    
    This change adds a `Chdir` method to `TestScript`
    that allows changing the working directory of the script.
    The implementation is the same as the "cd" command,
    which now relies on `Chdir`.
    
    The availability of this function matches similar functionality in the
    [`State.Chdir` method of rsc.io/script][1].
    (I ported some tests from rsc.io/script to testscript.)
    
      [1]: https://pkg.go.dev/rsc.io/script#State.Chdir
    abhinav authored and mvdan committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    31b9365 View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2024

  1. testscript: add kill command (#243)

    This allows sending a termination signal to backgrounded commands.
    
    Fixes #242.
    kortschak authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    2af95f2 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. testscript: clarify HOME and TMPDIR env var names

    They aren't always HOME and TMPDIR; on GOOS=windows they are different.
    mvdan committed May 9, 2024
    Configuration menu
    Copy the full SHA
    c8567cf View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2024

  1. all: Add Go 1.22, drop Go 1.20

    Switches CI to run against Go 1.21 and 1.22,
    and bumps the minimum required Go version to 1.21.
    
    Dropping 1.20 isn't strictly necessary;
    this is just matching prior upgrades.
    It can be added back if the maintainers prefer.
    abhinav authored and mvdan committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    1f3d244 View commit details
    Browse the repository at this point in the history
  2. update dependencies and rely on Go 1.21 APIs (#256)

    We had been using ancient versions of golang.org/x modules,
    which passed the tests but wasn't great as they contain bugs
    and most users would want their newer versions anyway.
    
    Assume Go 1.21 later; use slices.Compact and simplify a test.
    
    While here, update the setup-go action as well.
    mvdan authored Jun 10, 2024
    Configuration menu
    Copy the full SHA
    ee2fcaa View commit details
    Browse the repository at this point in the history
  3. cmd/testscript: remove redundant use of Failed (#257)

    The call to `T.Failed` and its associated comment are a
    legacy of previous implementation. The comment isn't accurate and the
    call isn't necessary (`FailNow` is always called even when `ContinueOnError`
    is set). Deprecate the associated `TFailed` type rather than removing it.
    rogpeppe authored Jun 10, 2024
    Configuration menu
    Copy the full SHA
    8300480 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2024

  1. testscript: add Config.Files (#258)

    This makes it possible to pass an arbitrary set of testscript
    files to be run instead of just a directory, making it possible
    for the testscript command to pass its command line arguments
    directly.
    
    In order to check that all the files are actually tested, we need
    to make the test harness implement independent subtest failure,
    and it's useful to see the name of the test too so that we
    can see the name disambiguation logic at work, which
    makes for changes to some of the other tests too.
    
    Note that the name deduping logic is somewhat improved from
    similar logic in cmd/testscript, in that it is always guaranteed
    to produce unique names even in the presence of filenames
    that look like deduped names.
    rogpeppe authored Jun 11, 2024
    Configuration menu
    Copy the full SHA
    b143f3f View commit details
    Browse the repository at this point in the history
  2. cmd/testscript: do not create an extra temporary directory (#259)

    It's bugged me for a long time that the error messages printed
    by the `testscript` command do not refer to the actual files
    passed to the command, but instead to a temporary
    file created for the purposes of the command.
    
    This change alters the testscript command so that it
    avoids creating an extra copy of the script file, instead
    using the new ability of the testscript package to interpret
    explicitly provided files instead.
    
    Gratifyingly, this also simplifies the logic quite a bit.
    
    Note: this is dependent on #258, so should not be reviewed
    until that lands.
    rogpeppe authored Jun 11, 2024
    Configuration menu
    Copy the full SHA
    5556500 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. Configuration menu
    Copy the full SHA
    66960b6 View commit details
    Browse the repository at this point in the history
  2. testscript: ignore result when interrupting background processes

    When an entire script runs and the end is reached, any background
    processes begun with a '&' command get interrupted or killed,
    depending on the platform and timeout, and we wait for them to finish.
    
    We also checked their resulting status code and failed if they didn't
    exit with a status code of 0. However, as explained in the comment,
    this would always fail on Windows, given that it doesn't have interrupt
    signals so we would kill directly, causing a "signal: killed" error.
    
    Worse, any failures here caused a `panic: fail now!` as that is how
    we bubble up errors when a script command is being run, but such panics
    were not being recovered once we reached the end of a script.
    Now that we don't check the result anymore here, the panics are gone.
    
    Fixes #228.
    Fixes #260.
    mvdan committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    ccf4b43 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. goproxytest: add test wrapper API

    I found that cmd/cue's tests were chatty because goproxytest
    was complaining about missing modules which did not matter.
    Because those logs always went directly to os.Stderr, I couldn't fix it
    without changing the API in this package.
    
    Rather than adding a complex API that takes a logger,
    since nearly all downstream use cases come from Go tests,
    add an API on top of testing.TB which makes its use much nicer.
    mvdan committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    361e7d2 View commit details
    Browse the repository at this point in the history
  2. dirhash: forward to golang.org/x/mod/sumdb/dirhash

    It seems like x/mod/sumdb/dirhash appeared way back in 2019,
    and we had not noticed until now.
    mvdan committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    3a65db1 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2024

  1. drop Go 1.21, add Go 1.23

    mvdan committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    5ce929e View commit details
    Browse the repository at this point in the history
  2. take advantage of Go 1.22

    cmp.Or and no longer needing to shallow copy range loop vars.
    
    While here, remove an unused parameter as spotted by gopls.
    mvdan committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    4794549 View commit details
    Browse the repository at this point in the history
  3. README: update the package list

    dirhash, modfile, module, and semver simply forward to the upstream
    packages now, so we should no longer advertise them to users.
    
    txtar is very close to that state, but not quite. Add a note.
    mvdan committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    e67a4aa View commit details
    Browse the repository at this point in the history
Loading