CodeChain-io / CodeChain-io/codechain-indexer

Inserting a row to the AssetImages table fails in the "test/-asset.spec.ts" test

Open
#338 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
21
Forks
15
PR merge metrics
No merged PRs in 30d

Description

You can run the command below to make the error.

```
NODE_ENV=test yarn mocha --exit -r ts-node/register --timeout 60000 --recursive test/api/asset.spec.ts
```

Here is the log from the Postgresql when you run the command above.

```
2019-11-18 17:00:42.129 KST [72847] ERROR: insert or update on table "AssetImages" violates foreign key constraint "AssetImages_assetType_fkey"
2019-11-18 17:00:42.129 KST [72847] DETAIL: Key (assetType)=(b03745e7296053068a1ac475b377656574b394d3) is not present in table "AssetSchemes".
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Run NODE_ENV=test yarn mocha --exit -r ts-node/register --timeout 60000 --recursive test/api/asset.spec.ts and inspect test/api/asset.spec.ts first. Trace the AssetImages insert and the AssetImages_assetType_fkey relationship to AssetSchemes; done means the test no longer fails with the reported PostgreSQL foreign-key error.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, typescript
Domain
databases, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.