Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run tests with fdp-play and bee 2.1 #929

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
env:
BEE_API_URL: 'http://127.0.0.1:1633'
BEE_PEER_API_URL: 'http://127.0.0.1:11633'
BEE_DEBUG_API_URL: 'http://127.0.0.1:1635'
BEE_PEER_DEBUG_API_URL: 'http://127.0.0.1:11635'
BEE_TEST_CHEQUEBOOK: true

jobs:
Expand Down
37 changes: 9 additions & 28 deletions .github/workflows/update_bee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ on:
repository_dispatch:
types: [update-bee]


jobs:
create-api-docs-pr:
runs-on: ubuntu-latest
Expand All @@ -30,18 +29,15 @@ jobs:
if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
bee_version=$(echo "${{ github.event.client_payload.beeVersion }}" | xargs )
bee_api_version=$(echo "${{ github.event.client_payload.apiVersion }}" | xargs )
bee_debug_api_version=$(echo "${{ github.event.client_payload.debugApiVersion }}" | xargs )
else
bee_version=$(echo "${{ github.event.inputs.beeVersion }}" | xargs )
bee_api_version=$(echo "${{ github.event.inputs.beeApiVersion }}" | xargs )
bee_debug_api_version=$(echo "${{ github.event.inputs.beeDebugApiVersion }}" | xargs )
fi

echo "BEE_VERSION_WITH_COMMIT=$bee_version" >> $GITHUB_ENV
echo "FINAL_CLEAN_BEE_VERSION=${bee_version/-*}" >> $GITHUB_ENV
echo "CLEAN_BEE_VERSION=${bee_version%-*}" >> $GITHUB_ENV
echo "API_VERSION=$bee_api_version" >> $GITHUB_ENV
echo "DEBUG_API_VERSION=$bee_debug_api_version" >> $GITHUB_ENV

- name: Replace Engine in package.json
uses: jossef/action-set-json-field@v1
Expand All @@ -57,13 +53,6 @@ jobs:
field: engines.beeApiVersion
value: ${{ env.API_VERSION }}

- name: Replace Debug API version in package.json
uses: jossef/action-set-json-field@v1
with:
file: package.json
field: engines.beeDebugApiVersion
value: ${{ env.DEBUG_API_VERSION }}

- name: Add trailing new-line to package.json
run: printf "\n" >> package.json

Expand All @@ -72,30 +61,22 @@ jobs:
with:
find: "export const SUPPORTED_BEE_VERSION_EXACT = '.*?'"
replace: "export const SUPPORTED_BEE_VERSION_EXACT = '${{ env.BEE_VERSION_WITH_COMMIT }}'"
include: "src/modules/debug/status.ts"
include: 'src/modules/debug/status.ts'
regex: true

- name: Replace SUPPORTED_API_VERSION for Status module
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "export const SUPPORTED_API_VERSION = '.*?'"
replace: "export const SUPPORTED_API_VERSION = '${{ env.API_VERSION }}'"
include: "src/modules/debug/status.ts"
regex: true

- name: Replace SUPPORTED_DEBUG_API_VERSION for Status module
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "export const SUPPORTED_DEBUG_API_VERSION = '.*?'"
replace: "export const SUPPORTED_DEBUG_API_VERSION = '${{ env.DEBUG_API_VERSION }}'"
include: "src/modules/debug/status.ts"
include: 'src/modules/debug/status.ts'
regex: true

- name: Replace README version
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "<!-- SUPPORTED_BEE_START -->.*?<!-- SUPPORTED_BEE_END -->"
replace: "<!-- SUPPORTED_BEE_START -->${{ env.FINAL_CLEAN_BEE_VERSION }}<!-- SUPPORTED_BEE_END -->"
find: '<!-- SUPPORTED_BEE_START -->.*?<!-- SUPPORTED_BEE_END -->'
replace: '<!-- SUPPORTED_BEE_START -->${{ env.FINAL_CLEAN_BEE_VERSION }}<!-- SUPPORTED_BEE_END -->'
include: README.md
regex: true

Expand All @@ -105,11 +86,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.REPO_GHA_PAT }}
with:
title: "chore: update to bee ${{ env.FINAL_CLEAN_BEE_VERSION }}"
body: "Updated Bee version ${{ env.BEE_VERSION_WITH_COMMIT }}"
branch: "bee-${{ env.FINAL_CLEAN_BEE_VERSION }}"
commit-message: "chore: update to bee"
author: "bee-worker <[email protected]>"
title: 'chore: update to bee ${{ env.FINAL_CLEAN_BEE_VERSION }}'
body: 'Updated Bee version ${{ env.BEE_VERSION_WITH_COMMIT }}'
branch: 'bee-${{ env.FINAL_CLEAN_BEE_VERSION }}'
commit-message: 'chore: update to bee'
author: 'bee-worker <[email protected]>'

- uses: joutvhu/get-release@v1
id: release-notes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"lint": "eslint --fix \"src/**/*.ts\" \"test/**/*.ts\" && prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint:check": "eslint \"src/**/*.ts\" \"test/**/*.ts\" && prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
"depcheck": "depcheck .",
"bee": "npx fdp-play start --detach --fresh"
"bee": "npx fdp-play start --detach --fresh --bee-version 2.1"
},
"dependencies": {
"@ethersphere/swarm-cid": "^0.1.0",
Expand Down
1 change: 0 additions & 1 deletion src/modules/debug/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// so if you are changing anything about them change the `update_bee` action accordingly!
export const SUPPORTED_BEE_VERSION_EXACT = '1.18.2-759f56f'
export const SUPPORTED_API_VERSION = '4.0.0'
export const SUPPORTED_DEBUG_API_VERSION = '4.0.0'

export const SUPPORTED_BEE_VERSION = SUPPORTED_BEE_VERSION_EXACT.split('-')[0]

Expand Down Expand Up @@ -82,7 +81,7 @@
* @returns true if the Bee node version is supported
* @deprecated Use `isSupportedExactVersion` instead
*/
// TODO: Remove on break

Check warning on line 84 in src/modules/debug/status.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Unexpected 'todo' comment: 'TODO: Remove on break'
export async function isSupportedVersion(requestOptions: BeeRequestOptions): Promise<boolean> {
return isSupportedExactVersion(requestOptions)
}
Expand Down
2 changes: 1 addition & 1 deletion test/shape/shape.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getTopologyShape } from './get-topology'
import { getWalletShape } from './get-wallet'
import { getWelcomeMessageShape } from './get-welcome-message'

test('GET /addresses', async () => {
it('GET /addresses', async () => {
await testGet('http://localhost:1635/addresses', getAddressesShape)
await testGet('http://localhost:1635/peers', getPeersShape)
await testGet('http://localhost:1635/topology', getTopologyShape)
Expand Down
Loading