Skip to content

Commit

Permalink
chore: add nightly tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mweberxyz committed Mar 15, 2024
1 parent e3ea2b6 commit 2be36a6
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Nightly tests

on:
- workflow_dispatch
- schedule:
- cron: "55 18 * * *"

jobs:
test:
if: github.repository == 'mweberxyz/nodejs-undici'
strategy:
fail-fast: false
max-parallel: 0
matrix:
runs-on:
- ubuntu-latest
- windows-latest
- macos-latest
uses: ./.github/workflows/test.yml
with:
node-version: 22-nightly
runs-on: ${{ matrix.runs-on }}
secrets: inherit

create-issue:
if: failure()
needs: test
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create issue
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const url = "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `Nightly tests failed - ${new Date().toISOString().substring(0, 10)}`,
body: `Refer to ${url} for details`
});
3 changes: 2 additions & 1 deletion test/trailers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { Client } = require('..')
const { createServer } = require('node:http')

test('response trailers missing is OK', async (t) => {
t = tspl(t, { plan: 1 })
t = tspl(t, { plan: 2 })

const server = createServer((req, res) => {
res.writeHead(200, {
Expand All @@ -25,6 +25,7 @@ test('response trailers missing is OK', async (t) => {
})

t.strictEqual(await body.text(), 'response')
t.strictEqual('abc', 'xyz')
})

await t.completed
Expand Down

0 comments on commit 2be36a6

Please sign in to comment.