Skip to content

Commit

Permalink
Merge pull request #98 from antmicro/mczyz/dashboard-rebase
Browse files Browse the repository at this point in the history
Improved frontend for dashboard
  • Loading branch information
tmichalak authored Aug 21, 2023
2 parents eb745fc + 06d4a7d commit 09bfa84
Show file tree
Hide file tree
Showing 33 changed files with 1,367 additions and 289 deletions.
72 changes: 0 additions & 72 deletions .github/scripts/create_verification_dashboard.sh

This file was deleted.

97 changes: 0 additions & 97 deletions .github/scripts/gen_coverage_reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,100 +42,6 @@ generate_coverage_reports(){
done
}

#--------------#
# HTML
#--------------#
generate_index_header(){
# This function creates a basic index html dashboard, which enables navigation
# Args
# OUTPUT_DIR - directory, where index.html will be placed
# GIT_SHA - git revision
check_args_count $# 2
OUTPUT_DIR=$1
GIT_SHA=$2
echo -e "${COLOR_WHITE}========== generate_index_header =============${COLOR_CLEAR}"
echo -e "${COLOR_WHITE}OUTPUT_DIR = ${OUTPUT_DIR}${COLOR_CLEAR}"
echo -e "${COLOR_WHITE}GIT_SHA = ${GIT_SHA}${COLOR_CLEAR}"

# Function Body
set +x
rm -rf ${OUTPUT_DIR}/index.html

# Header
echo -n "<!DOCTYPE html>
<html>
<body>
<h2>RISC-V VeeR EL2</h2>
<h3>Coverage Dashboard</h3>
<p>Revision: ${GIT_SHA}</p>
" >>${OUTPUT_DIR}/index.html

# Summary reports
echo -e "\n<hr>" >>${OUTPUT_DIR}/index.html
echo -e "\n<h3>Summary reports (all tests)</h3>" >>${OUTPUT_DIR}/index.html
}

generate_index_body(){
# This function creates a body for the index html
# Args
# OUTPUT_DIR - directory, where index.html will be placed
check_args_count $# 1
OUTPUT_DIR=$1
echo -e "${COLOR_WHITE}========== generate_index_body ===============${COLOR_CLEAR}"
echo -e "${COLOR_WHITE}OUTPUT_DIR = ${OUTPUT_DIR}${COLOR_CLEAR}"

echo "<h3>Coverage:</h3>" >>${OUTPUT_DIR}/index.html
echo "<ul>" >>${OUTPUT_DIR}/index.html
for COVERAGE in branch toggle all functional; do
PAGES=`find ${OUTPUT_DIR}/ -type d -name "${COVERAGE}_*" -printf "%P\n" | sort`
if [ -z "$PAGES" ]; then
echo "<li><em>${COVERAGE} report</em> (not enabled) </li>" >>${OUTPUT_DIR}/index.html
else
echo "<li><a href=\"${COVERAGE}/index.html\"><em>${COVERAGE} report</em></a></li>" >>${OUTPUT_DIR}/index.html
fi
done
echo "</ul>" >>${OUTPUT_DIR}/index.html

# Per-test reports
echo -e "\n<hr>" >>${OUTPUT_DIR}/index.html
echo -e "\n<h3>Individual test reports</h3>" >>${OUTPUT_DIR}/index.html

echo "<h3>Coverage:</h3>" >>${OUTPUT_DIR}/index.html

for COVERAGE in branch toggle all functional; do
echo "<h4>${COVERAGE}</h4>" >>${OUTPUT_DIR}/index.html
echo "<ul>" >>${OUTPUT_DIR}/index.html
PAGES=`find ${OUTPUT_DIR}/ -type d -name "${COVERAGE}_*" -printf "%P\n" | sort`
if [ -z "$PAGES" ]; then
echo -e "${COLOR_WHITE}There are no reports for coverage ${COVERAGE} ${COLOR_YELLOW}WARNING${COLOR_CLEAR}"
echo "<li>No data to display</li>" >>${OUTPUT_DIR}/index.html
fi
for PAGE in ${PAGES}; do
TEST=${PAGE/${COVERAGE}_/}
echo "<li><a href=\"${COVERAGE}_${TEST}/index.html\">${TEST}</a></li>" >>${OUTPUT_DIR}/index.html
done
echo "</ul>" >>${OUTPUT_DIR}/index.html
done

}

generate_index_footer(){
# This function creates a footer for the index html
# Args
# OUTPUT_DIR - directory, where index.html will be placed
check_args_count $# 1
OUTPUT_DIR=$1
echo -e "${COLOR_WHITE}========== generate_index_footer =============${COLOR_CLEAR}"
echo -e "${COLOR_WHITE}OUTPUT_DIR = ${OUTPUT_DIR}${COLOR_CLEAR}"

echo -n "
<hr>
<p> Copyright 2023 Antmicro</p>
</body>
</html>
" >>${OUTPUT_DIR}/index.html
}

#--------------#
# Script
#--------------#
Expand All @@ -155,9 +61,6 @@ GENHTML_OPTS="--no-function-coverage --no-source"
echo -e "${COLOR_WHITE}========== gen_coverage_reports ==============${COLOR_CLEAR}"

generate_coverage_reports ${OUTPUT_DIR} "${GENHTML_OPTS}"
generate_index_header ${OUTPUT_DIR} ${GIT_SHA}
generate_index_body ${OUTPUT_DIR}
generate_index_footer ${OUTPUT_DIR}

echo -e "${COLOR_WHITE}gen_coverage_reports ${COLOR_GREEN}SUCCEEDED${COLOR_CLEAR}"
echo -e "${COLOR_WHITE}========== gen_coverage_reports ==============${COLOR_CLEAR}"
2 changes: 2 additions & 0 deletions .github/scripts/indexgen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
source
31 changes: 31 additions & 0 deletions .github/scripts/indexgen/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source.template
GENDIR = source
BUILDDIR ?= build
ROOTDIR ?= work

all: clean html

# Sources
SOURCES = $(wildcard $(SOURCEDIR)/*.md)

# Generate sources
$(GENDIR):
@mkdir -p $@

$(GENDIR)/index.md: $(SOURCES) generate.py | $(GENDIR)
@rm -rf $(GENDIR)/*
@python3 generate.py --template "$(SOURCEDIR)" --root "$(ROOTDIR)" --output "$(GENDIR)"

# Build the final webpage. Pass the 'html' target to sphinx, copy report pages
html: Makefile $(GENDIR)/index.md
@$(SPHINXBUILD) -M $@ "$(GENDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@rsync -avr "$(ROOTDIR)/" "$(BUILDDIR)/html"
@bash update_styles.sh "$(BUILDDIR)"

clean:
@rm -rf $(BUILDDIR)
@rm -rf $(GENDIR)

.PHONY: all clean html
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 09bfa84

Please sign in to comment.