Skip to content
Merged
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
56 changes: 0 additions & 56 deletions .github/workflows/parse_logs.py

This file was deleted.

53 changes: 8 additions & 45 deletions .github/workflows/test-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ jobs:
java: [8, 11]
os: [ubuntu-latest, windows-latest]
python: [3.7, 3.8, 3.9]
outputs:
artifacts_availability: ${{ steps.status.outputs.ARTIFACTS_AVAILABLE }}
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -93,62 +91,29 @@ jobs:
python -m pip install --no-deps git+https://github.com/dask/distributed
python -m pip install --no-deps git+https://github.com/dask/dask-ml
- name: Test with pytest
if: success()
run: |
set -euo pipefail
pytest -n auto tests --dist loadfile | tee output-${{ matrix.python-version }}-log || (
echo '::set-output name=ARTIFACTS_AVAILABLE::true' && false
)
- name: Upload artifacts
if: |
failure()
&& steps.status.outcome == 'failure'
&& github.event_name == 'schedule'
&& github.repository == 'dask-contrib/dask-sql'
uses: actions/upload-artifact@v2
with:
name: output-${{ matrix.os }}-py${{ matrix.python }}-jdk${{ matrix.java }}-log
path: output-${{ matrix.os }}-py${{ matrix.python }}-jdk${{ matrix.java }}-log
retention-days: 5
pytest --junitxml=junit/test-results.xml --cov-report=xml -n auto tests --dist loadfile

report-failures:
name: Open issue for upstream dev failures
needs: test-dev
if: |
failure()
&& github.event_name == 'schedule'
&& needs.upstream-dev.outputs.artifacts_availability == 'true'
always()
&& needs.test-dev.result == 'failure'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- uses: actions/download-artifact@v2
with:
path: /tmp/workspace/logs
- name: Move all log files into a single directory
run: |
rsync -a /tmp/workspace/logs/output-*/ ./logs
ls -R ./logs
- name: Parse logs
run: |
shopt -s globstar
python .github/workflows/parse_logs.py logs/**/*-log
- name: Report failures
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const pytest_logs = fs.readFileSync('pytest-logs.txt', 'utf8');
const title = "⚠️ Nightly upstream-dev CI failed ⚠️"
const title = "⚠️ Upstream CI failed ⚠️"
const workflow_url = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`
const issue_body = `[Workflow Run URL](${workflow_url})\n${pytest_logs}`

const issue_body = `[Workflow Run URL](${workflow_url})`
// Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures
const query = `query($owner:String!, $name:String!, $creator:String!, $label:String!){
repository(owner: $owner, name: $name) {
Expand All @@ -163,27 +128,25 @@ jobs:
}
}
}`;

const variables = {
owner: context.repo.owner,
name: context.repo.repo,
label: 'CI',
label: 'upstream',
creator: "github-actions[bot]"
}
const result = await github.graphql(query, variables)

// If no issue is open, create a new issue,
// else update the body of the existing issue.
if (result.repository.issues.edges.length === 0) {
github.rest.issues.create({
github.issues.create({
owner: variables.owner,
repo: variables.name,
body: issue_body,
title: title,
labels: [variables.label]
})
} else {
github.rest.issues.update({
github.issues.update({
owner: variables.owner,
repo: variables.name,
issue_number: result.repository.issues.edges[0].node.number,
Expand Down