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

PKG -- [integration-test] Add initial integration test suite #1512

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
791abf1
Integration test config
Nov 29, 2022
3906b51
Add setups
Nov 29, 2022
8b97f87
Integration tests for main fcl functions
Nov 29, 2022
2505c07
Add account tests
Dec 12, 2022
fc4636e
Add block test
Dec 12, 2022
61f924f
Add events test
Dec 12, 2022
8ba91b8
Add getBlock test
Dec 12, 2022
fd37386
Add ping test
Dec 12, 2022
6e374e8
Rename account test
Dec 12, 2022
19ef560
Add integration test utils
Dec 12, 2022
50609bc
Merge branch 'master' into huyndo/integration-test
Dec 12, 2022
23fbf7f
Fix passing number instead of string in types test
Dec 13, 2022
21d65d3
Remove init test
Dec 13, 2022
799609b
Add test utils
Dec 13, 2022
141a2fa
Add getTransaction test
Dec 13, 2022
5dd651b
Add account test
Dec 13, 2022
52b006c
Refactor events test
Dec 13, 2022
db4d2b3
Refactor getBlock test
Dec 13, 2022
394887f
Add getBlockHeader test
Dec 13, 2022
3177c2d
add getCollection test
Dec 13, 2022
1890d2d
add getEvents test
Dec 13, 2022
3b5b060
Clean up package.json
Dec 13, 2022
10a3034
Add readme
Dec 13, 2022
2921bc6
Add flow CLI installation to Github action
Dec 13, 2022
f89e1f4
Change runner workflow to macos
Dec 14, 2022
35bb01d
run tests on ubuntu
Dec 15, 2022
a2b1026
Run workflow on macOS
Dec 15, 2022
f128546
Merge branch 'master' into huyndo/integration-test
Dec 15, 2022
337a696
Install CLI from Homebrew
Dec 15, 2022
6b069ab
added beta cli installation
Dec 20, 2022
50fd63b
fixed syntax error
Dec 20, 2022
7ce3323
converted back to macos
Dec 20, 2022
c169eb2
added sudo for flow installation
Dec 20, 2022
a15ae6a
fixed cli platform compatibility
Dec 20, 2022
7560d5d
updated custom cli platform
Dec 20, 2022
2f0cfee
added chmod to custom cli
Dec 20, 2022
bebdfff
changed binary arch of flow cli
Dec 20, 2022
fc4e3f0
Fix test setup order
Dec 20, 2022
033b717
Merge branch 'huyndo/integration-test' of github.com:onflow/fcl-js in…
Dec 20, 2022
66f9b58
added timeout
Dec 21, 2022
03ab26d
use run_id instead of cli_url
Dec 22, 2022
80d84d0
updated condition
Dec 22, 2022
448d4eb
fixed typo
Dec 22, 2022
cf2c5ad
updated echo cli_url
Dec 22, 2022
ede3761
added --stream to lerna
Dec 23, 2022
2e64173
updated lerna invocation script
Dec 23, 2022
80b92f5
reverted lerna to v5.6.2
Dec 23, 2022
f6642cd
added --detectOpenHandles to jest
Dec 23, 2022
8bb3bb8
added --forceExit to jest
Dec 23, 2022
3174d52
run grpc integration tests only
Dec 23, 2022
1466bf3
add grcp test before http
Dec 23, 2022
dba0cdd
fixed flow process termination
Dec 24, 2022
6f1df0b
name clarification
Dec 24, 2022
31457cd
changed test name
Dec 24, 2022
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
64 changes: 62 additions & 2 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,75 @@
name: FLOW-JS-SDK Continuous Integration

on:
workflow_dispatch:
inputs:
CLI_BUILD_RUN_ID:
description: "flow-cli artifact url"
type: string
pull_request:
branches: [master]

jobs:
test_pull_request:
integration:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Find artifact id for the cli
if: github.event.inputs.CLI_BUILD_RUN_ID != ''
run: >
ARTIFACT_ID=$(
curl
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
-H "X-GitHub-Api-Version: 2022-11-28"
https://api.github.com/repos/onflow/devex-tests/actions/runs/${{ github.event.inputs.CLI_BUILD_RUN_ID }}/artifacts
| jq ".artifacts[0].id")
&& echo ARTIFACT_ID=${ARTIFACT_ID}
&& echo "ARTIFACT_ID=${ARTIFACT_ID}" >> $GITHUB_ENV
&& echo "CLI_URL=https://api.github.com/repos/onflow/devex-tests/actions/artifacts/${ARTIFACT_ID}/zip" >> $GITHUB_ENV
&& echo CLI_URL=${{ env.CLI_URL }}

- name: Download flow-cli atrifact
if: github.event.inputs.CLI_BUILD_RUN_ID != ''
run: >
curl -L -o artifact.zip
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
-H "X-GitHub-Api-Version: 2022-11-28"
${{ env.CLI_URL }}
# https://api.github.com/repos/onflow/devex-tests/actions/artifacts/479746403/zip

- name: Unzip artifact
if: github.event.inputs.CLI_BUILD_RUN_ID != ''
run: unzip -j -o artifact.zip

- name: Copy flow binary
if: github.event.inputs.CLI_BUILD_RUN_ID != ''
run: |
sudo cp flow-x86_64-linux- /usr/local/bin/flow
sudo chmod a+x /usr/local/bin/flow
uname -a
ls -l /usr/local/bin/flow
flow version

# if no beta flow-cli is provided, install official version
- name: Install released flow-cli
if: github.event.inputs.CLI_BUILD_RUN_ID == ''
run: |
sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"
export PATH=/root/.local/bin:$PATH
flow version
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# brew install flow-cli

### Run tests

- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
- run: make ci
- name: Run all tests
run: |
export PATH=/root/.local/bin:$PATH
flow version
make ci
Loading