Skip to content

Commit

Permalink
fix: skip open attribute list step on e2e (#3481)
Browse files Browse the repository at this point in the history
* fix: skip open attribute list step on e2e

* adding quiet-pull option to avoid noisy logs on GH actions

* disable github cache temporarily

* removing cache from gh action
  • Loading branch information
danielbdias authored Dec 27, 2023
1 parent 20e795c commit 068e293
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 49 deletions.
51 changes: 8 additions & 43 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,80 +146,45 @@ jobs:
with:
fetch-depth: 0

- name: set cache keys
shell: bash
run: |
echo "WEB_CACHE_KEY=$(git log --pretty=tformat:"%H" -n1 web)" >> $GITHUB_ENV
echo "SERVER_CACHE_KEY=$(git log --pretty=tformat:"%H" -n1 server)" >> $GITHUB_ENV
echo "CLI_CACHE_KEY=$(git log --pretty=tformat:"%H" -n1 cli)" >> $GITHUB_ENV
# web
- name: Cache Web Build
id: cache-web-build
uses: actions/cache@v3
with:
path: web/build/
key: web-build-${{ env.WEB_CACHE_KEY }}

- name: Setup node
# if cache miss
if: steps.cache-web-build.outputs.cache-hit != 'true'
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: web/package-lock.json

- name: Cache dependencies
id: cache-nodemodules
# if cache miss
if: steps.cache-web-build.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: |
web/node_modules
/home/runner/.cache/Cypress
key: npm--${{ hashFiles('web/package-lock.json') }}
restore-keys: npm-

- name: Install dependencies
run: cd web/; npm ci
# if cache miss for build and deps
if: steps.cache-web-build.outputs.cache-hit != 'true' && steps.cache-nodemodules.outputs.cache-hit != 'true'

- run: cd web; CI= npm run build
if: steps.cache-web-build.outputs.cache-hit != 'true'
- name: Build UI
run: cd web; CI= npm run build

# go+docker
- name: Cache Build
id: cache-docker-build
uses: actions/cache@v3
with:
path: dist/
key: dist-${{env.SERVER_CACHE_KEY }}-${{env.CLI_CACHE_KEY }}-${{ hashFiles('.goreleaser.dev.yaml', 'Dockerfile') }}
- name: Setup go
if: steps.cache-docker-build.outputs.cache-hit != 'true'
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
cache: true
cache-dependency-path: "go.mod"
- uses: goreleaser/goreleaser-action@v4
if: steps.cache-docker-build.outputs.cache-hit != 'true'

- name: Release Go binaries
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser-pro
version: v1.22.0
args: release --skip=announce --snapshot -f .goreleaser.dev.yaml

- name: Move binaries to known location
if: steps.cache-docker-build.outputs.cache-hit != 'true'
run: |
find ./dist -name 'tracetest' -exec cp {} ./dist \;
find ./dist -name 'tracetest-server' -exec cp {} ./dist \;
chmod +x ./dist/tracetest ./dist/tracetest-server
- name: Export docker image
if: steps.cache-docker-build.outputs.cache-hit != 'true'
run: |
docker save --output dist/image.tar "kubeshop/tracetest:$TAG"
- name: Upload assets
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ build() {
}

up() {
docker compose $opts up -d --remove-orphans
docker compose $opts up --detach --remove-orphans --quiet-pull
}

stop() {
Expand Down
6 changes: 3 additions & 3 deletions web/cypress/e2e/TestRunDetail/Outputs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Outputs', () => {
// Open output flow from the Trace view (attributes)
cy.selectRunDetailMode(2);
cy.get('[data-cy=trace-node-database]', {timeout: 25000}).first().click({force: true});
cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]', {timeout: 25000}).click({force: true});
// cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]', {timeout: 25000}).click({force: true});
cy.get('[data-cy=attributes-search-container] input').type('db.name');
cy.get('[data-cy=attribute-row-db-name] .ant-dropdown-trigger').click();
cy.contains('Create test output').click();
Expand Down Expand Up @@ -46,7 +46,7 @@ describe('Outputs', () => {
// Open output flow from the Trace view (attributes)
cy.selectRunDetailMode(2);
cy.get('[data-cy=trace-node-database]', {timeout: 25000}).first().click({force: true});
cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]', {timeout: 25000}).click({force: true});
// cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]', {timeout: 25000}).click({force: true});
cy.get('[data-cy=attributes-search-container] input').type('db.name');
cy.get('[data-cy=attribute-row-db-name] .ant-dropdown-trigger').click();
cy.contains('Create test output').click();
Expand Down Expand Up @@ -89,7 +89,7 @@ describe('Outputs', () => {
// Open output flow from the Trace view (attributes)
cy.selectRunDetailMode(2);
cy.get('[data-cy=trace-node-database]', {timeout: 25000}).first().click({force: true});
cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]', {timeout: 25000}).click({force: true});
// cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]', {timeout: 25000}).click({force: true});
cy.get('[data-cy=attributes-search-container] input').type('db.name');
cy.get('[data-cy=attribute-row-db-name] .ant-dropdown-trigger').click();
cy.contains('Create test output').click();
Expand Down
4 changes: 2 additions & 2 deletions web/cypress/e2e/TestRunDetail/TestRunDetail.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Test Run Detail Views', () => {
it('Trace view -> show the attribute list for a specific span', () => {
cy.selectRunDetailMode(2);
cy.get('[data-cy=trace-node-http]').click();
cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]').click();
// cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]').click();

cy.get('[data-cy=attribute-list]').should('be.visible');
cy.get('[data-cy=attribute-row-http-method]').should('be.visible');
Expand All @@ -16,7 +16,7 @@ describe('Test Run Detail Views', () => {
it('Trace view -> attribute list', () => {
cy.selectRunDetailMode(2);
cy.get('[data-cy=trace-node-http]').click();
cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]').click();
// cy.get('[data-cy=toggle-drawer-SPAN_DETAILS]').click();

cy.get('[data-cy=attribute-list]').should('be.visible');
});
Expand Down

0 comments on commit 068e293

Please sign in to comment.