Skip to content

Commit 1990bdc

Browse files
authored
fix: authorize gateway in integration tests (#464)
Includes switch to pnpm (#465)
1 parent 6a2e02f commit 1990bdc

36 files changed

+25243
-66348
lines changed

.env.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,7 @@ PRINCIPAL_MAPPING = '{"did:web:example.com":"did:key:z6MktkCXwNmpqejQxYd7JHPcw7d
7171
INTEGRATION_TESTS_STORAGE_PROVIDER_DID = ''
7272
INTEGRATION_TESTS_STORAGE_PROVIDER_ENDPOINT = ''
7373
INTEGRATION_TESTS_STORAGE_PROVIDER_PROOF = ''
74+
75+
# Optional - custom gateway to authorize in integration tests (defaults to staging)
76+
INTEGRATION_TESTS_GATEWAY_DID = ''
77+
INTEGRATION_TESTS_GATEWAY_ENDPOINT = ''

.github/workflows/fetch-metrics-for-space.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
runs-on: ubuntu-latest
2222
timeout-minutes: 120
2323
steps:
24-
- uses: actions/checkout@v3
25-
- uses: actions/setup-node@v3
24+
- uses: actions/checkout@v4
25+
- uses: pnpm/action-setup@v4
26+
- uses: actions/setup-node@v4
2627
with:
27-
registry-url: 'https://registry.npmjs.org'
28-
node-version: 18
29-
cache: 'npm'
30-
- run: npm ci
28+
node-version: 20
29+
cache: 'pnpm'
30+
- run: pnpm install --frozen-lockfile
3131
- name: Run job
3232
env:
3333
DEBUG: '*'

.github/workflows/follow-filecoin-receipt-chain.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
runs-on: ubuntu-latest
2222
timeout-minutes: 120
2323
steps:
24-
- uses: actions/checkout@v3
25-
- uses: actions/setup-node@v3
24+
- uses: actions/checkout@v4
25+
- uses: pnpm/action-setup@v4
26+
- uses: actions/setup-node@v4
2627
with:
27-
registry-url: 'https://registry.npmjs.org'
28-
node-version: 18
29-
cache: 'npm'
30-
- run: npm ci
28+
node-version: 20
29+
cache: 'pnpm'
30+
- run: pnpm install --frozen-lockfile
3131
- name: Run job
3232
env:
3333
DEBUG: '*'

.github/workflows/get-oldest-pieces-pending-deal.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
env: ['staging', 'production']
2121
timeout-minutes: 20
2222
steps:
23-
- uses: actions/checkout@v3
24-
- uses: actions/setup-node@v3
23+
- uses: actions/checkout@v4
24+
- uses: pnpm/action-setup@v4
25+
- uses: actions/setup-node@v4
2526
with:
26-
registry-url: 'https://registry.npmjs.org'
2727
node-version: 20
28-
cache: 'npm'
29-
- run: npm ci
28+
cache: 'pnpm'
29+
- run: pnpm install --frozen-lockfile
3030
- name: Run job
3131
env:
3232
DEBUG: '*'

.github/workflows/test.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
name: Test
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-node@v3
14+
- uses: actions/checkout@v4
15+
- uses: pnpm/action-setup@v4
16+
- uses: actions/setup-node@v4
1617
with:
17-
registry-url: 'https://registry.npmjs.org'
18-
node-version: 18
19-
cache: 'npm'
20-
- run: npm ci
21-
- run: npm run lint
22-
- run: npm test
18+
node-version: 20
19+
cache: 'pnpm'
20+
- run: pnpm install --frozen-lockfile
21+
- run: pnpm lint
22+
- run: pnpm test
2323
env:
2424
AWS_REGION: 'us-west-2'
2525
AWS_ACCESS_KEY_ID: 'NOSUCH'

billing/package.json

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,38 @@
88
"coverage": "c8 -r text -r html npm test"
99
},
1010
"dependencies": {
11-
"@aws-sdk/client-dynamodb": "3.563.0",
12-
"@aws-sdk/client-sqs": "3.563.0",
13-
"@aws-sdk/util-dynamodb": "3.563.0",
14-
"@ipld/dag-json": "^10.2.3",
15-
"@ipld/dag-ucan": "^3.4.5",
16-
"@sentry/serverless": "^7.74.1",
17-
"@storacha/capabilities": "^1.2.0",
18-
"@ucanto/interface": "^10.2.0",
19-
"@ucanto/server": "^10.2.0",
20-
"big.js": "^6.2.1",
21-
"lru-cache": "^11.0.0",
22-
"multiformats": "^13.1.0",
23-
"p-retry": "^6.2.0",
24-
"stripe": "^14.2.0",
25-
"uint8arrays": "^5.1.0"
11+
"@aws-sdk/client-dynamodb": "catalog:",
12+
"@aws-sdk/client-sqs": "catalog:",
13+
"@aws-sdk/util-dynamodb": "catalog:",
14+
"@ipld/dag-json": "catalog:",
15+
"@ipld/dag-ucan": "catalog:",
16+
"@sentry/serverless": "catalog:",
17+
"@storacha/capabilities": "catalog:",
18+
"@ucanto/interface": "catalog:",
19+
"@ucanto/server": "catalog:",
20+
"big.js": "catalog:",
21+
"lru-cache": "catalog:",
22+
"multiformats": "catalog:",
23+
"p-retry": "catalog:",
24+
"sst": "catalog:",
25+
"stripe": "catalog:",
26+
"uint8arrays": "catalog:"
2627
},
2728
"devDependencies": {
28-
"@aws-sdk/client-glue": "3.563.0",
29-
"@dsnp/parquetjs": "^1.8.6",
30-
"@types/big.js": "^6.2.1",
31-
"aws-lambda": "^1.0.7",
32-
"c8": "^8.0.1",
33-
"csv-parser": "^3.0.0",
34-
"csv-stringify": "^6.4.6",
35-
"dotenv": "^16.4.5",
36-
"entail": "^2.1.1",
37-
"p-all": "^5.0.0",
38-
"testcontainers": "^10.7.1"
29+
"@aws-sdk/client-glue": "catalog:",
30+
"@aws-sdk/client-s3": "catalog:",
31+
"@dsnp/parquetjs": "catalog:",
32+
"@storacha/did-mailto": "catalog:",
33+
"@types/aws-lambda": "catalog:",
34+
"@types/big.js": "catalog:",
35+
"aws-lambda": "catalog:",
36+
"c8": "catalog:",
37+
"csv-parser": "catalog:",
38+
"csv-stringify": "catalog:",
39+
"dotenv": "catalog:",
40+
"entail": "catalog:",
41+
"p-all": "catalog:",
42+
"testcontainers": "catalog:"
3943
},
4044
"engines": {
4145
"node": ">=16.15"

carpark/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
"test": "ava --verbose --timeout=60s --fail-fast **/*.test.js"
77
},
88
"dependencies": {
9-
"@aws-sdk/client-eventbridge": "3.563.0",
10-
"@aws-sdk/client-sqs": "3.563.0",
11-
"@sentry/serverless": "^7.74.1"
9+
"@aws-sdk/client-eventbridge": "catalog:",
10+
"@aws-sdk/client-sqs": "catalog:",
11+
"@sentry/serverless": "catalog:"
1212
},
1313
"devDependencies": {
14-
"@aws-sdk/client-s3": "3.563.0",
15-
"constructs": "*",
16-
"ava": "^4.3.3",
17-
"nanoid": "^4.0.0",
18-
"p-retry": "6.2.0",
19-
"testcontainers": "^10.7.1"
14+
"@aws-sdk/client-s3": "catalog:",
15+
"@types/aws-lambda": "catalog:",
16+
"ava": "catalog:",
17+
"nanoid": "catalog:",
18+
"p-retry": "catalog:",
19+
"testcontainers": "catalog:"
2020
}
2121
}

filecoin/metrics.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as Block from 'multiformats/block'
44
import { sha256 } from 'multiformats/hashes/sha2'
55
import { Piece } from '@web3-storage/data-segment'
66

7-
import { hasOkReceipt } from '@storacha/upload-service-infra-upload-api/utils.js'
7+
import { hasOkReceipt } from '../upload-api/utils.js'
88
import { AGGREGATE_ACCEPT, AGGREGATE_OFFER, METRICS_NAMES } from './constants.js'
99
import { DecodeBlockOperationError, NotFoundWorkflowError } from './errors.js'
1010

@@ -24,7 +24,7 @@ import { DecodeBlockOperationError, NotFoundWorkflowError } from './errors.js'
2424
* Metrics:
2525
* - AGGREGATE_ACCEPT_TOTAL: increment number of `aggregate/accept` success receipts
2626
*
27-
* @param {import('@storacha/upload-service-infra-upload-api/types.js').UcanStreamInvocation[]} ucanInvocations
27+
* @param {import('../upload-api/types.js').UcanStreamInvocation[]} ucanInvocations
2828
* @param {import('./types.js').FilecoinMetricsCtx} ctx
2929
*/
3030
export async function updateAggregateAcceptTotal (ucanInvocations, ctx) {
@@ -50,7 +50,7 @@ export async function updateAggregateAcceptTotal (ucanInvocations, ctx) {
5050
* - AGGREGATE_OFFER_PIECES_TOTAL: increment number of pieces included in `aggregate/offer` success receipts
5151
* - AGGREGATE_OFFER_PIECES_SIZE_TOTAL: increment size of pieces included of `aggregate/offer` success receipts
5252
*
53-
* @param {import('@storacha/upload-service-infra-upload-api/types.js').UcanStreamInvocation[]} ucanInvocations
53+
* @param {import('../upload-api/types.js').UcanStreamInvocation[]} ucanInvocations
5454
* @param {import('./types.js').FilecoinAggregateOfferMetricsCtx} ctx
5555
*/
5656
export async function updateAggregateOfferTotal (ucanInvocations, ctx) {
@@ -104,7 +104,7 @@ export async function updateAggregateOfferTotal (ucanInvocations, ctx) {
104104
/**
105105
* Get a map of workflows that include given capability.
106106
*
107-
* @param {import('@storacha/upload-service-infra-upload-api/types.js').UcanStreamInvocation[]} ucanInvocations
107+
* @param {import('../upload-api/types.js').UcanStreamInvocation[]} ucanInvocations
108108
* @param {string} capability
109109
* @param {import('./types.js').FilecoinAggregateOfferMetricsCtx} ctx
110110
*/

filecoin/package.json

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,38 @@
66
"test": "ava --serial --no-worker-threads --verbose --timeout=60s --fail-fast **/*.test.js"
77
},
88
"dependencies": {
9-
"@aws-sdk/client-dynamodb": "3.563.0",
10-
"@aws-sdk/client-s3": "3.563.0",
11-
"@aws-sdk/client-sqs": "3.563.0",
12-
"@ipld/car": "^5.2.6",
13-
"@ipld/dag-json": "^10.2.3",
14-
"@sentry/serverless": "^7.74.1",
15-
"@storacha/filecoin-api": "^1.1.6",
16-
"@storacha/filecoin-client": "^1.0.1",
17-
"@ucanto/client": "^9.0.1",
18-
"@ucanto/core": "^10.3.1",
19-
"@ucanto/interface": "^10.2.0",
20-
"@ucanto/principal": "^9.0.1",
21-
"@ucanto/transport": "^9.1.1",
22-
"@web3-storage/data-segment": "^5.3.0",
23-
"fr32-sha2-256-trunc254-padded-binary-tree-multihash": "^3.3.0",
24-
"multiformats": "^13.1.0",
25-
"p-retry": "^6.2.0",
26-
"uint8arrays": "^5.1.0"
9+
"@aws-sdk/client-dynamodb": "catalog:",
10+
"@aws-sdk/client-s3": "catalog:",
11+
"@aws-sdk/client-sqs": "catalog:",
12+
"@aws-sdk/util-dynamodb": "catalog:",
13+
"@ipld/car": "catalog:",
14+
"@ipld/dag-json": "catalog:",
15+
"@sentry/serverless": "catalog:",
16+
"@storacha/filecoin-api": "catalog:",
17+
"@storacha/filecoin-client": "catalog:",
18+
"@ucanto/client": "catalog:",
19+
"@ucanto/core": "catalog:",
20+
"@ucanto/interface": "catalog:",
21+
"@ucanto/principal": "catalog:",
22+
"@ucanto/server": "catalog:",
23+
"@ucanto/transport": "catalog:",
24+
"@web3-storage/data-segment": "catalog:",
25+
"fr32-sha2-256-trunc254-padded-binary-tree-multihash": "catalog:",
26+
"multiformats": "catalog:",
27+
"p-retry": "catalog:",
28+
"sst": "catalog:",
29+
"uint8arrays": "catalog:"
2730
},
2831
"devDependencies": {
29-
"@web-std/blob": "3.0.5",
30-
"ava": "^4.3.3",
31-
"constructs": "*",
32-
"delay": "^6.0.0",
33-
"nanoid": "^4.0.0",
34-
"p-defer": "^4.0.0",
35-
"sqs-consumer": "^7.4.0",
36-
"testcontainers": "^10.7.1"
32+
"@ipld/dag-pb": "catalog:",
33+
"@web-std/blob": "catalog:",
34+
"@types/aws-lambda": "catalog:",
35+
"ava": "catalog:",
36+
"delay": "catalog:",
37+
"nanoid": "catalog:",
38+
"p-defer": "catalog:",
39+
"sqs-consumer": "catalog:",
40+
"testcontainers": "catalog:"
3741
},
3842
"eslintConfig": {
3943
"rules": {

filecoin/test/metrics-aggregate-accept-total.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { randomAggregate } from '@storacha/filecoin-api/test'
99
import { updateAggregateAcceptTotal } from '../metrics.js'
1010
import { METRICS_NAMES, STREAM_TYPE } from '../constants.js'
1111

12-
import { adminMetricsTableProps } from '@storacha/upload-service-infra-upload-api/tables/index.js'
12+
import { adminMetricsTableProps } from '../../upload-api/tables/index.js'
1313
import { createFilecoinMetricsTable } from '../store/metrics.js'
1414
import { createWorkflowStore } from '../store/workflow.js'
1515

filecoin/test/metrics-aggregate-offer-total.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Piece } from '@web3-storage/data-segment'
1414
import { updateAggregateOfferTotal } from '../metrics.js'
1515
import { METRICS_NAMES, STREAM_TYPE } from '../constants.js'
1616

17-
import { adminMetricsTableProps } from '@storacha/upload-service-infra-upload-api/tables/index.js'
17+
import { adminMetricsTableProps } from '../../upload-api/tables/index.js'
1818
import { createFilecoinMetricsTable } from '../store/metrics.js'
1919
import { createWorkflowStore } from '../store/workflow.js'
2020
import { createInvocationStore } from '../store/invocation.js'

indexer/package.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@
66
"test": "entail '**/*.spec.js'"
77
},
88
"dependencies": {
9-
"@aws-sdk/client-dynamodb": "3.563.0",
10-
"@aws-sdk/client-sqs": "3.563.0",
11-
"@aws-sdk/util-dynamodb": "3.563.0",
12-
"@ipld/dag-json": "^10.2.1",
13-
"@storacha/one-webcrypto": "^1.0.1",
14-
"@ucanto/interface": "^10.2.0",
15-
"multiformats": "^13.1.1",
16-
"p-map": "^7.0.2",
17-
"p-retry": "^6.2.0"
9+
"@aws-sdk/client-dynamodb": "catalog:",
10+
"@aws-sdk/client-sqs": "catalog:",
11+
"@aws-sdk/util-dynamodb": "catalog:",
12+
"@ipld/dag-json": "catalog:",
13+
"@sentry/serverless": "catalog:",
14+
"@storacha/one-webcrypto": "catalog:",
15+
"@ucanto/interface": "catalog:",
16+
"multiformats": "catalog:",
17+
"p-map": "catalog:",
18+
"p-retry": "catalog:"
1819
},
1920
"devDependencies": {
20-
"@ucanto/server": "^10.2.0",
21-
"entail": "^2.1.2"
21+
"@types/aws-lambda": "catalog:",
22+
"@ucanto/server": "catalog:",
23+
"entail": "catalog:",
24+
"testcontainers": "catalog:"
2225
}
2326
}

0 commit comments

Comments
 (0)