Skip to content

Commit

Permalink
simpler test glob (#2456)
Browse files Browse the repository at this point in the history
Closes: #1913

## Description

This set out to use the Ava default file glob (i.e. no custom setting)
but ultimately doesn't for two reasons:
- requires all the non-test files to have a preceding underscore (this
is both laborious to complete and not a unanimously well received
outcome)
- would allow test files to have any file name, including
`foo.fixture.js`. We like the `.test.js` consistency

Since I did move a bunch of files to use underscores, I left that change
in here, along with the script that does it. I have no qualms about
removing them at reviewer request.

This also includes a little CI change that saved me time, [ci: no-bail
so all packages run
lint](8618d95)


### Security Considerations

n/a

### Scaling Considerations

n/a

### Documentation Considerations

Consistent with existing practices. There is a lot of underscore now,
but it's not required.

### Testing Considerations

CI

### Compatibility Considerations

Not exported

### Upgrade Considerations

none
  • Loading branch information
turadg committed Sep 20, 2024
2 parents 7948a69 + e68a24e commit c101168
Show file tree
Hide file tree
Showing 185 changed files with 169 additions and 134 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"docs:markdown-for-agoric-documentation-repo": "typedoc --plugin typedoc-plugin-markdown --tsconfig tsconfig.build.json",
"update": "lernaupdate --dedupe",
"format": "prettier --write .github packages",
"lint": "prettier --check .github packages && lerna run lint",
"lint": "prettier --check .github packages && lerna run --no-bail lint",
"lint-fix": "lerna run --no-bail lint-fix",
"test": "lerna run --ignore @endo/skel test",
"test": "lerna run --ignore @endo/skel --no-bail test",
"test262": "lerna run test262",
"build": "lerna run build",
"build-ts": "tsc --build tsconfig.build.json"
Expand Down
1 change: 0 additions & 1 deletion packages/base64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/base64/test/main.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'ava';
import { atob as origAtob, btoa as origBtoa } from './capture-atob-btoa.js';
import { atob as origAtob, btoa as origBtoa } from './_capture-atob-btoa.js';
import { encodeBase64, decodeBase64, atob, btoa } from '../index.js';

/**
Expand Down
1 change: 0 additions & 1 deletion packages/bundle-source/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
]
},
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/bundle-source/test/sanity-unfiltered.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Like test-sanity.js but with { stackFiltering: 'verbose' }
import { makeSanityTests } from './sanity.js';
import { makeSanityTests } from './_sanity.js';

makeSanityTests('verbose');
2 changes: 1 addition & 1 deletion packages/bundle-source/test/sanity.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Like test-sanity-unfiltered.js but with { stackFiltering: 'concise' }
import { makeSanityTests } from './sanity.js';
import { makeSanityTests } from './_sanity.js';

// 'concise' is currently the default. But the purpose of this
// test is not to test what choice is the default. Since the behavior
Expand Down
1 change: 0 additions & 1 deletion packages/captp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/check-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/cjs-module-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions packages/cli/test/demo/index.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import test from 'ava';
import { $ } from 'execa';
import { makeSectionTest } from '../section.js';
import { withContext } from '../with-context.js';
import { daemonContext } from '../daemon-context.js';
import { makeSectionTest } from '../_section.js';
import { withContext } from '../_with-context.js';
import { daemonContext } from '../_daemon-context.js';
import * as counterExample from './counter-example.js';
import * as doublerAgent from './doubler-agent.js';
import * as confinedScript from './confined-script.js';
Expand Down
1 change: 0 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/compartment-mapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/daemon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/env-options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/evasive-transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
2 changes: 1 addition & 1 deletion packages/evasive-transform/test/elide-comment.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from './prepare-test-env-ava-fixture.js';
import { test } from './_prepare-test-env-ava-fixture.js';
import { elideComment } from '../src/transform-comment.js';
import { evadeCensorSync } from '../src/index.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/evasive-transform/test/evade-censor.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { evadeCensorSync } from '../src/index.js';
import { test } from './prepare-test-env-ava-fixture.js';
import { test } from './_prepare-test-env-ava-fixture.js';

/**
* Removes all linefeeds from string
Expand Down
2 changes: 1 addition & 1 deletion packages/evasive-transform/test/location-unmapper.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import babelParser from '@babel/parser';
import { makeLocationUnmapper } from '../src/location-unmapper.js';
import { test } from './prepare-test-env-ava-fixture.js';
import { test } from './_prepare-test-env-ava-fixture.js';

const { parse: parseBabel } = babelParser;

Expand Down
2 changes: 1 addition & 1 deletion packages/evasive-transform/test/transform-comment.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from './prepare-test-env-ava-fixture.js';
import { test } from './_prepare-test-env-ava-fixture.js';
import { evadeComment } from '../src/transform-comment.js';

test('evadeComment() - Node type becomes CommentBlock', async t => {
Expand Down
1 change: 0 additions & 1 deletion packages/eventual-send/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
2 changes: 1 addition & 1 deletion packages/eventual-send/src/exports.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @endo/no-polymorphic-call, import/no-extraneous-dependencies, no-restricted-globals */
import { expectType } from 'tsd';
import { E } from '../test/get-hp.js';
import { E } from '../test/_get-hp.js';
import type { ERef, FarRef } from './exports.js';

// Check the legacy ERef type
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/eventual-send/test/deep-send.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import '@endo/lockdown/commit-debug.js';
import test from 'ava';

import { E } from './get-hp.js';
import { E } from './_get-hp.js';

const { freeze } = Object;

Expand Down
2 changes: 1 addition & 1 deletion packages/eventual-send/test/deep-stacks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import '@endo/lockdown/commit-debug.js';
import test from 'ava';

import { E } from './get-hp.js';
import { E } from './_get-hp.js';

const testDeepStacksWhen = test.macro({
title: (title, loggerDescription, _getLogger) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/eventual-send/test/e.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@endo/lockdown/commit-debug.js';
import test from 'ava';

import { E, HandledPromise } from './get-hp.js';
import { E, HandledPromise } from './_get-hp.js';

test('E reexports', async t => {
t.is(E.resolve, HandledPromise.resolve, 'E reexports resolve');
Expand Down
2 changes: 1 addition & 1 deletion packages/eventual-send/test/eventual-send.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import '@endo/lockdown/commit-debug.js';
import test from 'ava';

import { HandledPromise } from './get-hp.js';
import { HandledPromise } from './_get-hp.js';

const { getPrototypeOf } = Object;
const { details: X } = assert;
Expand Down
2 changes: 1 addition & 1 deletion packages/eventual-send/test/hp.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@endo/lockdown/commit-debug.js';
import test from 'ava';

import { HandledPromise } from './get-hp.js';
import { HandledPromise } from './_get-hp.js';

const { getPrototypeOf, isFrozen } = Object;
const { ownKeys, getOwnPropertyDescriptor } = Reflect;
Expand Down
2 changes: 1 addition & 1 deletion packages/eventual-send/test/proxy.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@endo/lockdown/commit-debug.js';
import test from 'ava';

import { HandledPromise } from './get-hp.js';
import { HandledPromise } from './_get-hp.js';

test('resolveWithPresence with proxy options', async t => {
const l = t.log; // decomment this line for debug aid
Expand Down
2 changes: 1 addition & 1 deletion packages/eventual-send/test/thenable.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@endo/lockdown/commit-debug.js';
import test from 'ava';

import { E, HandledPromise } from './get-hp.js';
import { E, HandledPromise } from './_get-hp.js';

const verifySimplePromise = async (t, resolve) => {
const p = new Promise(_ => {});
Expand Down
2 changes: 1 addition & 1 deletion packages/eventual-send/test/types.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@endo/lockdown/commit-debug.js';
import test from 'ava';

import { E } from './get-hp.js';
import { E } from './_get-hp.js';

/**
* Mock a Remotable maker.
Expand Down
1 change: 0 additions & 1 deletion packages/exo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/exo/test/label-instances.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line import/order
import test from './prepare-test-env-ava-label-instances.js';
import test from './_prepare-test-env-ava-label-instances.js';

// eslint-disable-next-line import/order
import { passStyleOf } from '@endo/far';
Expand Down
2 changes: 1 addition & 1 deletion packages/exo/test/legacy-guard-tolerance.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
makeLegacyAwaitArgGuard,
makeLegacyMethodGuard,
makeLegacyInterfaceGuard,
} from './make-legacy-guards.js';
} from './_make-legacy-guards.js';
import { makeExo } from '../src/exo-makers.js';

test('legacy guard tolerance', async t => {
Expand Down
1 change: 0 additions & 1 deletion packages/far/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/immutable-arraybuffer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/import-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/init/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"homepage": "https://github.com/endojs/endo#readme",
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
]
},
Expand Down
1 change: 0 additions & 1 deletion packages/lockdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"homepage": "https://github.com/endojs/endo#readme",
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
]
},
Expand Down
1 change: 0 additions & 1 deletion packages/lp32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
1 change: 0 additions & 1 deletion packages/marshal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/marshal/test/encodePassable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
makeDecodePassable,
} from '../src/encodePassable.js';
import { compareRank, makeComparatorKit } from '../src/rankOrder.js';
import { unsortedSample } from './marshal-test-data.js';
import { unsortedSample } from './_marshal-test-data.js';

const buffers = {
__proto__: null,
Expand Down
2 changes: 1 addition & 1 deletion packages/marshal/test/marshal-capdata.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import test from '@endo/ses-ava/prepare-endo.js';

import { passStyleOf, Far } from '@endo/pass-style';
import { makeMarshal } from '../src/marshal.js';
import { roundTripPairs } from './marshal-test-data.js';
import { roundTripPairs } from './_marshal-test-data.js';

const {
freeze,
Expand Down
2 changes: 1 addition & 1 deletion packages/marshal/test/marshal-justin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import test from '@endo/ses-ava/prepare-endo.js';
import { Remotable, makeTagged } from '@endo/pass-style';
import { makeMarshal } from '../src/marshal.js';
import { decodeToJustin } from '../src/marshal-justin.js';
import { jsonJustinPairs } from './marshal-test-data.js';
import { jsonJustinPairs } from './_marshal-test-data.js';

// this only includes the tests that do not use liveSlots

Expand Down
2 changes: 1 addition & 1 deletion packages/marshal/test/marshal-smallcaps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import test from '@endo/ses-ava/prepare-endo.js';
import { Far, makeTagged, passStyleOf } from '@endo/pass-style';
import { makeMarshal } from '../src/marshal.js';

import { roundTripPairs } from './marshal-test-data.js';
import { roundTripPairs } from './_marshal-test-data.js';

const {
freeze,
Expand Down
2 changes: 1 addition & 1 deletion packages/marshal/test/marshal-stringify.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import test from '@endo/ses-ava/prepare-endo.js';

import { Far } from '@endo/pass-style';
import { stringify, parse } from '../src/marshal-stringify.js';
import { roundTripPairs } from './marshal-test-data.js';
import { roundTripPairs } from './_marshal-test-data.js';

const { isFrozen } = Object;

Expand Down
2 changes: 1 addition & 1 deletion packages/marshal/test/rankOrder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
getIndexCover,
assertRankSorted,
} from '../src/rankOrder.js';
import { unsortedSample, sortedSample } from './marshal-test-data.js';
import { unsortedSample, sortedSample } from './_marshal-test-data.js';

test('compareRank is reflexive', async t => {
await fc.assert(
Expand Down
1 change: 0 additions & 1 deletion packages/memoize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
},
"ava": {
"files": [
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
Expand Down
Loading

0 comments on commit c101168

Please sign in to comment.