Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
[issue-172] Version pinned devnet allocations (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethen authored Nov 6, 2023
1 parent 11e5f45 commit 8c1d724
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 688 deletions.
Binary file removed .DS_Store
Binary file not shown.
28 changes: 0 additions & 28 deletions .devnet/addresses.json

This file was deleted.

466 changes: 0 additions & 466 deletions .devnet/allocs-l1.json

This file was deleted.

53 changes: 0 additions & 53 deletions .devnet/devnetL1.json

This file was deleted.

32 changes: 0 additions & 32 deletions .github/scripts/comment.js

This file was deleted.

33 changes: 4 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,6 @@ jobs:
run: |
go test -v -coverprofile=coverage.out ./internal/...
# - name: Generate Coverage
# run: |
# go tool cover -func=coverage.out | grep total | awk '{print $3}' >> out.txt
# echo "::set-output name=coverage::$(cat out.txt)"

# - name: Find Coverage Comment
# uses: peter-evans/find-comment@v1
# id: fc
# with:
# issue-number: ${{ github.event.pull_request.number }}
# comment-author: 'github-actions[bot]'
# body-includes: '### Current Test Coverage'

# - name: Add Coverage Comment
# uses: actions/github-script@v6
# env:
# DATA: ${{ steps.fc.outputs.comment-id }}

# with:
# script: |
# const script = require('./.github/scripts/comment.js')
# await script({github, context, core})

e2e-test:
runs-on: larger-runner
steps:
Expand All @@ -75,13 +52,11 @@ jobs:
with:
go-version: 1.21

# - name: Install foundry
# uses: foundry-rs/foundry-toolchain@v1
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1

# - name: Setup devnet Resources
# id: devnet
# run: |
# make devnet-allocs
- name: Generate devnet allocations
run: make devnet-allocs

- name: Run E2E Integration Tests
run: make e2e-test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ config.env
/.idea
genesis.json
alert-routing.yaml
/.devnet/
packages/contracts-bedrock/deploy-config/devnetL1.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Unit tests can run using the following project level command(s):

Integration tests are written that leverage the existing [op-e2e](https://github.com/ethereum-optimism/optimism/tree/develop/op-e2e) testing framework for spinning up pieces of the bedrock system. Additionally, the [httptest](https://pkg.go.dev/net/http/httptest) library is used to mock downstream alerting services (e.g. Slack's webhook API). These tests live in the project's `/e2e` directory.
Running integration tests requires generating devnet allocation files for compatibility with the Optimism monorepo. The following `scripts/devnet_allocs.sh` can be run to do this generation. If successful, a new `.devnet` directory will be created in the project's root directory.
Running integration tests requires generating devnet allocation files for compatibility with the Optimism monorepo. The following `scripts/devnet_allocs.sh` can be run to do this generation. If successful, a new `.devnet` directory will be created in the project's root directory. These allocations should only be regenerated when go.mod rebases to a new monorepo release.

Integration tests can run using the following project level command(s):

Expand Down
65 changes: 0 additions & 65 deletions mocks/alert_client.go

This file was deleted.

42 changes: 28 additions & 14 deletions scripts/devnet-allocs.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
## Download and enter the OP monorepo
echo "Downloading Optimism monorepo..."
git clone https://github.com/ethereum-optimism/optimism.git
cd optimism
git checkout develop
#!/bin/bash

VERSION=$(cat go.mod | grep ethereum-optimism/optimism | awk '{print $2}' | sed 's/\/v//g')
VERSION=$(echo ${VERSION} | sed 's/v//g')

REPO_NAME=optimism-$(echo ${VERSION} | sed 's/v//g')

echo "Downloading ${REPO_NAME} ..."
git clone --branch v${VERSION} https://github.com/ethereum-optimism/optimism.git ${REPO_NAME}
cd ${REPO_NAME}

## Generate devnet allocations and persist them all into .devnet folder
echo "Initializing monorepo..."
make install-geth
git submodule update --init --recursive
make devnet-allocs
mv .devnet ../.devnet
make install-geth &&
git submodule update --init --recursive &&
make devnet-allocs &&
cp -R .devnet ../. &&
mv packages/contracts-bedrock/deploy-config/devnetL1.json ../.devnet/devnetL1.json

## Clean up
echo "Cleaning up..."
cd ../
rm -rf optimism
STATUS=$?

## Force cleanup of monorepo
echo "${STATUS} Cleaning up ${REPO_NAME} repo ..."
cd ../ &&
rm -rf ${REPO_NAME}

if [ $? -eq 0 ] ; then
echo "Successfully cleaned up ${REPO_NAME} repo"
exit ${STATUS}
else
echo "Failed to clean up ${REPO_NAME} repo"
exit ${STATUS}
fi

0 comments on commit 8c1d724

Please sign in to comment.