Skip to content

Commit

Permalink
Merge branch 'develop' into _update-deps/runtimeverification/hs-backe…
Browse files Browse the repository at this point in the history
…nd-booster
  • Loading branch information
geo2a authored Sep 21, 2023
2 parents 80b3a66 + 7c0bc44 commit 06734ea
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ jobs:
BENCHER_ADAPTER: json
run: |
set -euxo pipefail
workspace=$(pwd)
docker run --name k-posting-profiling-tests-${GITHUB_SHA} \
docker run --name k-posting-profiling-tests-${GITHUB_SHA} \
--rm -it --detach \
-e BENCHER_API_TOKEN=$BENCHER_API_TOKEN \
-e BENCHER_PROJECT=$BENCHER_PROJECT \
Expand All @@ -67,6 +66,7 @@ jobs:
-e GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME \
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
-e GITHUB_REF=$GITHUB_REF \
-e GITHUB_SHA=${GITHUB_SHA} \
--workdir /opt/workspace \
-v "${workspace}:/opt/workspace" \
${BASE_OS}:${BASE_DISTRO}
Expand All @@ -77,14 +77,14 @@ jobs:
- name: 'Getting Performance Tests Results'
run: |
set -euxo pipefail
docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c './k-distribution/tests/profiling/post_results_to_develop.py'
docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c './k-distribution/tests/profiling/post_results_to_develop.py ${GITHUB_SHA}'
- name: 'Posting Performance Tests Results'
run: |
set -euxo pipefail
docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c 'bencher run \
--if-branch "develop" --else-if-branch "master" \
--file .profiling-results.json --err --ci-only-on-alert \
--github-actions "${GITHUB_TOKEN}" 'echo "Exporting report"'
--github-actions "${GITHUB_TOKEN}" "echo Exporting report"'
- name: 'Tear down Docker'
if: always()
run: |
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
Out:String
#Equals
"x = 21\n"
"x = 11\n"
}
#And
{
Store:Map
#Equals
0 |-> 21
0 |-> 11
}
#Or
{
Expand All @@ -19,7 +19,7 @@
{
Store:Map
#Equals
0 |-> 11
0 |-> 21
}
#Or
{
Expand All @@ -31,31 +31,31 @@
{
Store:Map
#Equals
0 |-> 21
0 |-> 33
}
#Or
{
Out:String
#Equals
"x = 11\n"
"x = 16\n"
}
#And
{
Store:Map
#Equals
0 |-> 33
0 |-> 16
}
#Or
{
Out:String
#Equals
"x = 16\n"
"x = 21\n"
}
#And
{
Store:Map
#Equals
0 |-> 16
0 |-> 21
}
#Or
{
Expand Down
14 changes: 8 additions & 6 deletions k-distribution/tests/profiling/post_results_to_develop.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
import json
import sys
import subprocess

COMMIT_SHA=''
COMMIT_SHA = sys.argv[1]
FROM_BRANCH=''
TO_BRANCH='develop'

Expand All @@ -24,10 +25,6 @@ def execute_command(command):

return result.stdout

# git command to get the last commit in develop
commit_command = [ 'git', 'log', '--format=\"%H\"', '-n', '1' ]
COMMIT_SHA = execute_command(commit_command).strip('\"').strip('\"\n')

# curl command to get the branch name of last commit in develop
API_URL = 'https://api.github.com/repos/runtimeverification/k/commits/' \
+ COMMIT_SHA + '/pulls'
Expand All @@ -36,6 +33,9 @@ def execute_command(command):
'\"X-GitHub-Api-Version:', '2022-11-28\"', API_URL]
FROM_BRANCH = json.loads(execute_command(branch_command))[0]['head']['label']

# If FROM_BRANCH contains user information get only the branch name
if ':' in FROM_BRANCH: FROM_BRANCH = FROM_BRANCH.split(':')[1]

print("Exporting last bencher report from", FROM_BRANCH, "to", TO_BRANCH)

# This command will generate a JSON file with a list containing the last reports
Expand All @@ -49,6 +49,8 @@ def execute_command(command):
k_framework = [item for item in data if item['project']['slug'] == 'k-framework'
and item['branch']['slug'] == FROM_BRANCH]

print("Found", len(k_framework), "reports for k-framework in", FROM_BRANCH)

# Append the last 6 reports to the list, they correspond to the last performance
# execution on the last commit in FROM_BRANCH
def get_name_and_value(item):
Expand All @@ -64,7 +66,7 @@ def get_name_and_value(item):

branch = item['branch']
print("Appended:", benchmark_name, "created in", item['created'],
"on branch", branch['name'], "with version", branch['version']['number'])
"on branch", branch['name'], "with id", branch['version']['number'])

data.update({benchmark_name: {metric_name_size: {"value": value_size},
metric_name_memory: {"value": value_memory}}
Expand Down
2 changes: 1 addition & 1 deletion kernel/src/main/java/org/kframework/unparser/KPrint.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private Term disambiguateForUnparse(Module mod, Term t) {
private String unparseInternal(Module mod, K input, ColorSetting colorize) {
ExpandMacros expandMacros = ExpandMacros.forNonSentences(mod, files, kompileOptions, true);
return Formatter.format(
new AddBrackets(mod).addBrackets((ProductionReference) disambiguateForUnparse(mod, KOREToTreeNodes.apply(KOREToTreeNodes.up(mod, expandMacros.expand(input)), mod))), options.color(tty.stdout, files.getEnv()));
new AddBrackets(mod).addBrackets((ProductionReference) disambiguateForUnparse(mod, KOREToTreeNodes.apply(KOREToTreeNodes.up(mod, expandMacros.expand(input)), mod))), colorize);
}

public K abstractTerm(Module mod, K term) {
Expand Down

0 comments on commit 06734ea

Please sign in to comment.